Disallow restart if one is already pending
This commit is contained in:
@@ -152,6 +152,12 @@ namespace Torch.Commands
|
|||||||
[Command("restart", "Restarts the server.")]
|
[Command("restart", "Restarts the server.")]
|
||||||
public void Restart(int countdownSeconds = 10, bool save = true)
|
public void Restart(int countdownSeconds = 10, bool save = true)
|
||||||
{
|
{
|
||||||
|
if (_restartPending)
|
||||||
|
{
|
||||||
|
Context.Respond("A restart is already pending.").
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
_restartPending = true;
|
_restartPending = true;
|
||||||
Task.Run(() =>
|
Task.Run(() =>
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user