core: use static methods for TimeSpan

This commit is contained in:
Bogdan
2023-04-09 04:21:09 +03:00
parent 95a69df7b8
commit f3b02cc53b
2 changed files with 2 additions and 2 deletions

View File

@@ -752,6 +752,6 @@ namespace Jackett.Common.Indexers
// TODO: remove this implementation and use gloal cache // TODO: remove this implementation and use gloal cache
protected static List<CachedQueryResult> cache = new List<CachedQueryResult>(); protected static List<CachedQueryResult> cache = new List<CachedQueryResult>();
protected static readonly TimeSpan cacheTime = new TimeSpan(0, 9, 0); protected static readonly TimeSpan cacheTime = TimeSpan.FromMinutes(9);
} }
} }

View File

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