mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Make NetImport sync interval work (needs some testing)
This commit is contained in:
@@ -75,7 +75,6 @@ namespace NzbDrone.Core.Jobs
|
||||
new ScheduledTask{ Interval = 5, TypeName = typeof(MessagingCleanupCommand).FullName},
|
||||
new ScheduledTask{ Interval = updateInterval, TypeName = typeof(ApplicationUpdateCommand).FullName},
|
||||
// new ScheduledTask{ Interval = 3*60, TypeName = typeof(UpdateSceneMappingCommand).FullName},
|
||||
new ScheduledTask{ Interval = 12*60, TypeName = typeof(NetImportSyncCommand).FullName},
|
||||
new ScheduledTask{ Interval = 6*60, TypeName = typeof(CheckHealthCommand).FullName},
|
||||
new ScheduledTask{ Interval = 24*60, TypeName = typeof(RefreshMovieCommand).FullName},
|
||||
new ScheduledTask{ Interval = 24*60, TypeName = typeof(HousekeepingCommand).FullName},
|
||||
@@ -87,6 +86,12 @@ namespace NzbDrone.Core.Jobs
|
||||
TypeName = typeof(RssSyncCommand).FullName
|
||||
},
|
||||
|
||||
new ScheduledTask
|
||||
{
|
||||
Interval = GetNetImportSyncInterval(),
|
||||
TypeName = typeof(NetImportSyncCommand).FullName
|
||||
},
|
||||
|
||||
new ScheduledTask
|
||||
{
|
||||
Interval = _configService.DownloadedEpisodesScanInterval,
|
||||
@@ -140,6 +145,23 @@ namespace NzbDrone.Core.Jobs
|
||||
return interval;
|
||||
}
|
||||
|
||||
private int GetNetImportSyncInterval()
|
||||
{
|
||||
var interval = _configService.NetImportSyncInterval;
|
||||
|
||||
if (interval > 0 && interval < 10)
|
||||
{
|
||||
return 10;
|
||||
}
|
||||
|
||||
if (interval < 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return interval;
|
||||
}
|
||||
|
||||
public void Handle(CommandExecutedEvent message)
|
||||
{
|
||||
var scheduledTask = _scheduledTaskRepository.All().SingleOrDefault(c => c.TypeName == message.Command.Body.GetType().FullName);
|
||||
|
Reference in New Issue
Block a user