From 191c6e695b2a1565b41ac25fee513046eacaaede Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 27 Aug 2013 22:31:39 -0400 Subject: [PATCH] update default task schedules --- .../ScheduledTasks/Tasks/DeleteCacheFileTask.cs | 12 +++++++++--- .../ScheduledTasks/Tasks/DeleteLogFileTask.cs | 12 +++++++++--- .../ScheduledTasks/Tasks/SystemUpdateTask.cs | 1 + 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/MediaBrowser.Common.Implementations/ScheduledTasks/Tasks/DeleteCacheFileTask.cs b/MediaBrowser.Common.Implementations/ScheduledTasks/Tasks/DeleteCacheFileTask.cs index 9a62f4ed37..d4b6c0b9e8 100644 --- a/MediaBrowser.Common.Implementations/ScheduledTasks/Tasks/DeleteCacheFileTask.cs +++ b/MediaBrowser.Common.Implementations/ScheduledTasks/Tasks/DeleteCacheFileTask.cs @@ -35,9 +35,15 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks.Tasks /// IEnumerable{BaseTaskTrigger}. public IEnumerable GetDefaultTriggers() { - var trigger = new DailyTrigger { TimeOfDay = TimeSpan.FromHours(2) }; //2am - - return new[] { trigger }; + // Until we can vary these default triggers per server and MBT, we need something that makes sense for both + return new ITaskTrigger[] { + + // At startup + new StartupTrigger (), + + // Every so often + new IntervalTrigger { Interval = TimeSpan.FromHours(24)} + }; } /// diff --git a/MediaBrowser.Common.Implementations/ScheduledTasks/Tasks/DeleteLogFileTask.cs b/MediaBrowser.Common.Implementations/ScheduledTasks/Tasks/DeleteLogFileTask.cs index bcead321dc..15f955723a 100644 --- a/MediaBrowser.Common.Implementations/ScheduledTasks/Tasks/DeleteLogFileTask.cs +++ b/MediaBrowser.Common.Implementations/ScheduledTasks/Tasks/DeleteLogFileTask.cs @@ -35,9 +35,15 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks.Tasks /// IEnumerable{BaseTaskTrigger}. public IEnumerable GetDefaultTriggers() { - var trigger = new DailyTrigger { TimeOfDay = TimeSpan.FromHours(2) }; //2am - - return new[] { trigger }; + // Until we can vary these default triggers per server and MBT, we need something that makes sense for both + return new ITaskTrigger[] { + + // At startup + new StartupTrigger (), + + // Every so often + new IntervalTrigger { Interval = TimeSpan.FromHours(24)} + }; } /// diff --git a/MediaBrowser.Common.Implementations/ScheduledTasks/Tasks/SystemUpdateTask.cs b/MediaBrowser.Common.Implementations/ScheduledTasks/Tasks/SystemUpdateTask.cs index 0a134b5e59..33917125e2 100644 --- a/MediaBrowser.Common.Implementations/ScheduledTasks/Tasks/SystemUpdateTask.cs +++ b/MediaBrowser.Common.Implementations/ScheduledTasks/Tasks/SystemUpdateTask.cs @@ -48,6 +48,7 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks.Tasks /// IEnumerable{BaseTaskTrigger}. public IEnumerable GetDefaultTriggers() { + // Until we can vary these default triggers per server and MBT, we need something that makes sense for both return new ITaskTrigger[] { // At startup