1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-26 09:49:00 +00:00

update interval for existing tasks.

This commit is contained in:
kay.one 2013-05-20 21:46:30 -07:00
parent 8e89847f30
commit 4a8139f5ba

View file

@ -60,14 +60,11 @@ public void Handle(ApplicationStartedEvent message)
foreach (var defaultTask in defaultTasks)
{
var currentDefinition = currentTasks.SingleOrDefault(c => c.TypeName == defaultTask.TypeName);
var currentDefinition = currentTasks.SingleOrDefault(c => c.TypeName == defaultTask.TypeName) ?? defaultTask;
if (currentDefinition == null)
{
currentDefinition = defaultTask;
_scheduledTaskRepository.Upsert(currentDefinition);
}
currentDefinition.Interval = defaultTask.Interval;
_scheduledTaskRepository.Upsert(currentDefinition);
}
}