From e093a57172173762bf957a8e34be0d264df1e8b2 Mon Sep 17 00:00:00 2001 From: Laura Gomez Date: Thu, 18 Jun 2020 17:25:17 -0400 Subject: [PATCH] refactor : supporting feature where sleeptime changes due to a meeting. --- .../Services/Scheduler/AbstractScheduledAction.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ICD.Common.Utils/Services/Scheduler/AbstractScheduledAction.cs b/ICD.Common.Utils/Services/Scheduler/AbstractScheduledAction.cs index bcfc6fd..205445c 100644 --- a/ICD.Common.Utils/Services/Scheduler/AbstractScheduledAction.cs +++ b/ICD.Common.Utils/Services/Scheduler/AbstractScheduledAction.cs @@ -25,11 +25,10 @@ namespace ICD.Common.Utils.Services.Scheduler public void Run() { - RunFinal(); - NextRunTimeUtc = GetNextRunTimeUtc(); + NextRunTimeUtc = RunFinal(); } - public void UpdateNextRunTime() + protected void UpdateNextRunTime() { NextRunTimeUtc = GetNextRunTimeUtc(); } @@ -37,11 +36,11 @@ namespace ICD.Common.Utils.Services.Scheduler /// /// Runs when the action has hit its scheduled time /// - public abstract void RunFinal(); + protected abstract DateTime? RunFinal(); /// /// Runs after RunFinal in order to set the next run time of this action /// - public abstract DateTime? GetNextRunTimeUtc(); + protected abstract DateTime? GetNextRunTimeUtc(); } } \ No newline at end of file