Disallow restart if one is already pending

This commit is contained in:
John Gross
2018-04-13 12:07:21 -07:00
committed by GitHub
parent c1e315fa40
commit b1edd62c0b

View File

@@ -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(() =>
{