Require a lock on the restart process to avoid double restarts causing unexpected behavior
This commit is contained in:
@@ -31,6 +31,13 @@ type Environment interface {
|
||||
// not be returned.
|
||||
Stop() error
|
||||
|
||||
// Restart a server instance. If already stopped the process will be started. This function
|
||||
// will return an error if the server is already performing a restart process as to avoid
|
||||
// unnecessary double/triple/quad looping issues if multiple people press restart or spam the
|
||||
// button to restart.
|
||||
Restart() error
|
||||
IsRestarting() bool
|
||||
|
||||
// Waits for a server instance to stop gracefully. If the server is still detected
|
||||
// as running after seconds, an error will be returned, or the server will be terminated
|
||||
// depending on the value of the second argument.
|
||||
|
||||
Reference in New Issue
Block a user