UpdateService: first update check after 1 hour

This commit is contained in:
kaso17 2018-04-17 11:35:34 +02:00
parent 427428d09b
commit 457449866e
1 changed files with 3 additions and 1 deletions

View File

@ -57,11 +57,13 @@ namespace Jackett.Common.Services
private async void UpdateWorkerThread()
{
var delayHours = 1; // first check after 1 hour (for users not running jackett 24/7)
while (true)
{
locker.WaitOne((int)new TimeSpan(24, 0, 0).TotalMilliseconds);
locker.WaitOne((int)new TimeSpan(delayHours, 0, 0).TotalMilliseconds);
locker.Reset();
await CheckForUpdates();
delayHours = 24; // following checks only once/24 hours
}
}