mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 10:47:08 -07:00
Better task interval fetching
(cherry picked from commit fddf2d1fc8b600d8f82b2dbfd2376b0538c3cc83)
This commit is contained in:
parent
b3352564fa
commit
8e92c55a35
1 changed files with 13 additions and 3 deletions
|
@ -118,9 +118,19 @@ namespace NzbDrone.Core.Jobs
|
|||
|
||||
private int GetBackupInterval()
|
||||
{
|
||||
var interval = _configService.BackupInterval;
|
||||
var intervalMinutes = _configService.BackupInterval;
|
||||
|
||||
return interval * 60 * 24;
|
||||
if (intervalMinutes < 1)
|
||||
{
|
||||
intervalMinutes = 1;
|
||||
}
|
||||
|
||||
if (intervalMinutes > 7)
|
||||
{
|
||||
intervalMinutes = 7;
|
||||
}
|
||||
|
||||
return intervalMinutes * 60 * 24;
|
||||
}
|
||||
|
||||
private int GetRssSyncInterval()
|
||||
|
@ -154,7 +164,7 @@ namespace NzbDrone.Core.Jobs
|
|||
public void HandleAsync(ConfigSavedEvent message)
|
||||
{
|
||||
var rss = _scheduledTaskRepository.GetDefinition(typeof(RssSyncCommand));
|
||||
rss.Interval = _configService.RssSyncInterval;
|
||||
rss.Interval = GetRssSyncInterval();
|
||||
|
||||
var backup = _scheduledTaskRepository.GetDefinition(typeof(BackupCommand));
|
||||
backup.Interval = GetBackupInterval();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue