Better task interval fetching

Fixes #706
Fixes #716
Fixes #705
pull/750/head
Qstick 4 years ago
parent 1756438fb0
commit f96424f4bd

@ -120,6 +120,11 @@ namespace NzbDrone.Core.Jobs
{
var interval = _configService.BackupInterval;
if (interval < 1)
{
interval = 1;
}
return interval * 60 * 24;
}
@ -154,12 +159,12 @@ 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 = _configService.BackupInterval;
backup.Interval = GetBackupInterval();
_scheduledTaskRepository.UpdateMany(new List<ScheduledTask>{ rss, backup });
_scheduledTaskRepository.UpdateMany(new List<ScheduledTask> { rss, backup });
}
}
}

Loading…
Cancel
Save