mirror of
https://github.com/Readarr/Readarr
synced 2026-01-20 14:31:27 +01:00
parent
1756438fb0
commit
f96424f4bd
1 changed files with 8 additions and 3 deletions
|
|
@ -120,6 +120,11 @@ private int GetBackupInterval()
|
|||
{
|
||||
var interval = _configService.BackupInterval;
|
||||
|
||||
if (interval < 1)
|
||||
{
|
||||
interval = 1;
|
||||
}
|
||||
|
||||
return interval * 60 * 24;
|
||||
}
|
||||
|
||||
|
|
@ -154,12 +159,12 @@ public void Handle(CommandExecutedEvent message)
|
|||
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…
Reference in a new issue