1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-07-04 11:07:59 +02:00

Fixed: No restart requirement for Refresh Monitored interval change

This commit is contained in:
Qstick 2022-05-08 16:11:53 -05:00
parent 5824ba963b
commit 1caced614e
4 changed files with 1136 additions and 1122 deletions

View File

@ -65,10 +65,10 @@ function DownloadClientOptions(props) {
<FormInputGroup
type={inputTypes.NUMBER}
name="checkForFinishedDownloadInterval"
min={0}
min={1}
max={120}
unit="minutes"
helpText={translate('HelpText')}
helpText={translate('RefreshMonitoredIntervalHelpText')}
onChange={onInputChange}
{...settings.checkForFinishedDownloadInterval}
/>

View File

@ -116,7 +116,7 @@ function IndexerOptions(props) {
min={0}
max={120}
unit="minutes"
helpText={translate('HelpText')}
helpText={translate('RssSyncHelpText')}
helpTextWarning={translate('RSSSyncIntervalHelpTextWarning')}
helpLink="https://wiki.servarr.com/radarr/faq#how-does-radarr-work"
onChange={onInputChange}

View File

@ -121,7 +121,7 @@ public void Handle(ApplicationStartedEvent message)
new ScheduledTask
{
Interval = Math.Max(_configService.CheckForFinishedDownloadInterval, 1),
Interval = GetRefreshMonitoredInterval(),
TypeName = typeof(RefreshMonitoredDownloadsCommand).FullName,
Priority = CommandPriority.High
}
@ -192,6 +192,18 @@ private int GetRssSyncInterval()
return interval;
}
private int GetRefreshMonitoredInterval()
{
var interval = _configService.CheckForFinishedDownloadInterval;
if (interval < 1)
{
return 1;
}
return interval;
}
private int GetImportListSyncInterval()
{
//Enforce 6 hour min on list sync
@ -228,13 +240,14 @@ public void HandleAsync(ConfigSavedEvent message)
backup.Interval = GetBackupInterval();
var refreshMonitoredDownloads = _scheduledTaskRepository.GetDefinition(typeof(RefreshMonitoredDownloadsCommand));
refreshMonitoredDownloads.Interval = _configService.CheckForFinishedDownloadInterval;
refreshMonitoredDownloads.Interval = GetRefreshMonitoredInterval();
_scheduledTaskRepository.UpdateMany(new List<ScheduledTask> { rss, importList, refreshMonitoredDownloads, backup });
_cache.Find(rss.TypeName).Interval = rss.Interval;
_cache.Find(importList.TypeName).Interval = importList.Interval;
_cache.Find(backup.TypeName).Interval = backup.Interval;
_cache.Find(refreshMonitoredDownloads.TypeName).Interval = refreshMonitoredDownloads.Interval;
}
}
}

File diff suppressed because it is too large Load Diff