diff --git a/TGServerService/DreamDaemon.cs b/TGServerService/DreamDaemon.cs index d7d5226721..ff6fac5c66 100644 --- a/TGServerService/DreamDaemon.cs +++ b/TGServerService/DreamDaemon.cs @@ -286,7 +286,8 @@ namespace TGServerService pcpu.Dispose(); } - bool BadStart; + WriteCurrentDDLog("Crash detected!"); + lock (watchdogLock) { currentStatus = TGDreamDaemonStatus.HardRebooting; @@ -295,7 +296,7 @@ namespace TGServerService if (AwaitingShutdown == ShutdownRequestPhase.Pinged) return; - BadStart = (DateTime.Now - starttime).TotalSeconds < DDBadStartTime; + var BadStart = (DateTime.Now - starttime).TotalSeconds < DDBadStartTime; if (BadStart) { ++retries; @@ -311,8 +312,6 @@ namespace TGServerService TGServerService.WriteWarning(msg, TGServerService.EventID.DDWatchdogRebootingServer); } } - if (BadStart) - WriteCurrentDDLog("Crash detected!"); var res = StartImpl(true); if (res != null)