From b26cf731288dac5f1bebeb6df9b631c1c639b8ed Mon Sep 17 00:00:00 2001 From: ryannewington Date: Wed, 19 Dec 2018 10:37:25 +1100 Subject: [PATCH] Fixes #158 - Scheduled interval trigger stops firing after the controller has been manually stopped and restarted --- src/Lithnet.Miiserver.AutoSync/MAInterface/MAController.cs | 1 - .../Triggers/ActiveDirectoryChangeTrigger.cs | 2 +- .../Triggers/ScheduledExecutionTrigger.cs | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Lithnet.Miiserver.AutoSync/MAInterface/MAController.cs b/src/Lithnet.Miiserver.AutoSync/MAInterface/MAController.cs index 1f6c2c4..0ea0144 100644 --- a/src/Lithnet.Miiserver.AutoSync/MAInterface/MAController.cs +++ b/src/Lithnet.Miiserver.AutoSync/MAInterface/MAController.cs @@ -1440,7 +1440,6 @@ private void Init() this.LogInfo("Starting action processing queue"); this.UpdateExecutionStatus(ControllerState.Idle, null, null); - // ReSharper disable once InconsistentlySynchronizedField foreach (ExecutionParameters action in this.pendingActions.GetConsumingEnumerable(this.controllerCancellationTokenSource.Token)) { this.controllerCancellationTokenSource.Token.ThrowIfCancellationRequested(); diff --git a/src/Lithnet.Miiserver.AutoSync/Triggers/ActiveDirectoryChangeTrigger.cs b/src/Lithnet.Miiserver.AutoSync/Triggers/ActiveDirectoryChangeTrigger.cs index e6ca78c..ff357e9 100644 --- a/src/Lithnet.Miiserver.AutoSync/Triggers/ActiveDirectoryChangeTrigger.cs +++ b/src/Lithnet.Miiserver.AutoSync/Triggers/ActiveDirectoryChangeTrigger.cs @@ -177,7 +177,7 @@ private void Notify(IAsyncResult result) if (DateTime.Now < this.nextTriggerAfter) { - this.Trace("Discarding change because next trigger time has not been reached"); + //this.Trace("Discarding change because next trigger time has not been reached"); return; } diff --git a/src/Lithnet.Miiserver.AutoSync/Triggers/ScheduledExecutionTrigger.cs b/src/Lithnet.Miiserver.AutoSync/Triggers/ScheduledExecutionTrigger.cs index 50fd7d1..8312230 100644 --- a/src/Lithnet.Miiserver.AutoSync/Triggers/ScheduledExecutionTrigger.cs +++ b/src/Lithnet.Miiserver.AutoSync/Triggers/ScheduledExecutionTrigger.cs @@ -100,6 +100,7 @@ public override void Start(string managementAgentName) return; } + this.HasFired = false; this.SetupTimer(); }