From b1edd62c0b17066dcf8b35827f1ae2ef0b0236e3 Mon Sep 17 00:00:00 2001 From: John Gross Date: Fri, 13 Apr 2018 12:07:21 -0700 Subject: [PATCH] Disallow restart if one is already pending --- Torch/Commands/TorchCommands.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Torch/Commands/TorchCommands.cs b/Torch/Commands/TorchCommands.cs index 9e904ee..3d487e5 100644 --- a/Torch/Commands/TorchCommands.cs +++ b/Torch/Commands/TorchCommands.cs @@ -152,6 +152,12 @@ namespace Torch.Commands [Command("restart", "Restarts the server.")] public void Restart(int countdownSeconds = 10, bool save = true) { + if (_restartPending) + { + Context.Respond("A restart is already pending."). + return; + } + _restartPending = true; Task.Run(() => { @@ -267,4 +273,4 @@ namespace Torch.Commands }, this, TaskContinuationOptions.RunContinuationsAsynchronously); } } -} \ No newline at end of file +}