mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 04:07:40 +02:00
fix can't catch exception issue
- Origin code can't catch exception in code, and all exceptions goes into first chance exception hanlding. - releated: #1266 - http://stackoverflow.com/a/5383408/2833083 - https://msdn.microsoft.com/en-us/magazine/jj991977.aspx?f=255&MSPPError=-2147217396
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Threading.Tasks;
|
||||
using System.Timers;
|
||||
using System.Windows;
|
||||
using Wox.Core;
|
||||
@@ -94,18 +95,25 @@ namespace Wox
|
||||
}
|
||||
}
|
||||
|
||||
[Conditional("RELEASE")]
|
||||
private void AutoUpdates()
|
||||
{
|
||||
if (_settings.AutoUpdates)
|
||||
Task.Run(async () =>
|
||||
{
|
||||
// check udpate every 5 hours
|
||||
var timer = new Timer(1000 * 60 * 60 * 5);
|
||||
timer.Elapsed += (s, e) => { Updater.UpdateApp(); };
|
||||
timer.Start();
|
||||
if (_settings.AutoUpdates)
|
||||
{
|
||||
// check udpate every 5 hours
|
||||
var timer = new Timer(1000 * 60 * 60 * 5);
|
||||
timer.Elapsed += async (s, e) =>
|
||||
{
|
||||
await Updater.UpdateApp();
|
||||
};
|
||||
timer.Start();
|
||||
|
||||
// check updates on startup
|
||||
Updater.UpdateApp();
|
||||
}
|
||||
// check updates on startup
|
||||
await Updater.UpdateApp();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void RegisterExitEvents()
|
||||
|
||||
Reference in New Issue
Block a user