Disallow restart if one is already pending
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user