diff --git a/ICD.Common.Utils/Services/Scheduler/AbstractScheduledAction.cs b/ICD.Common.Utils/Services/Scheduler/AbstractScheduledAction.cs index 0439f07..3cfbd2f 100644 --- a/ICD.Common.Utils/Services/Scheduler/AbstractScheduledAction.cs +++ b/ICD.Common.Utils/Services/Scheduler/AbstractScheduledAction.cs @@ -27,7 +27,12 @@ namespace ICD.Common.Utils.Services.Scheduler public void Run() { RunFinal(); - NextRunTime = UpdateRunTime(); + NextRunTime = GetNextRunTime(); + } + + public void UpdateNextRunTime() + { + NextRunTime = GetNextRunTime(); } /// @@ -38,6 +43,6 @@ namespace ICD.Common.Utils.Services.Scheduler /// /// Runs after RunFinal in order to set the next run time of this action /// - public abstract DateTime? UpdateRunTime(); + public abstract DateTime? GetNextRunTime(); } } \ No newline at end of file diff --git a/ICD.Common.Utils/Services/Scheduler/ActionSchedulerService.cs b/ICD.Common.Utils/Services/Scheduler/ActionSchedulerService.cs index ee59816..ea232a0 100644 --- a/ICD.Common.Utils/Services/Scheduler/ActionSchedulerService.cs +++ b/ICD.Common.Utils/Services/Scheduler/ActionSchedulerService.cs @@ -137,7 +137,7 @@ namespace ICD.Common.Utils.Services.Scheduler return; } - long msToNextAction = (long)(DateTime.Now - action.NextRunTime.Value).TotalMilliseconds; + long msToNextAction = (long)(action.NextRunTime.Value - DateTime.Now).TotalMilliseconds; m_Timer.Reset(msToNextAction); } finally