fix: remove unnecessary default timer interval

This commit is contained in:
Jeffery Thompson
2018-07-12 14:36:58 -04:00
parent 1f7819e536
commit c25a82399d

View File

@@ -9,8 +9,6 @@ namespace ICD.Common.Utils.Services.Scheduler
{ {
public sealed class ActionSchedulerService : IActionSchedulerService, IDisposable public sealed class ActionSchedulerService : IActionSchedulerService, IDisposable
{ {
private const long MAX_TIMER_INTERVAL = 5*60*1000; // 5 minutes
private readonly List<IScheduledAction> m_Actions; private readonly List<IScheduledAction> m_Actions;
private readonly SafeTimer m_Timer; private readonly SafeTimer m_Timer;
private readonly SafeCriticalSection m_CriticalSection; private readonly SafeCriticalSection m_CriticalSection;
@@ -140,8 +138,7 @@ namespace ICD.Common.Utils.Services.Scheduler
} }
long msToNextAction = (long)(DateTime.Now - action.NextRunTime.Value).TotalMilliseconds; long msToNextAction = (long)(DateTime.Now - action.NextRunTime.Value).TotalMilliseconds;
long timerDueTime = Math.Min(msToNextAction, MAX_TIMER_INTERVAL); m_Timer.Reset(msToNextAction);
m_Timer.Reset(timerDueTime);
} }
finally finally
{ {