Set server to stopping when stop command is sent
This commit is contained in:
parent
00bc71afd1
commit
4e1b7988bf
|
@ -1,6 +1,7 @@
|
||||||
package server
|
package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/pterodactyl/wings/api"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
@ -28,6 +29,15 @@ func (s *Server) onConsoleOutput() *func(string) {
|
||||||
|
|
||||||
s.SetState(ProcessRunningState)
|
s.SetState(ProcessRunningState)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If the command sent to the server is one that should stop the server we will need to
|
||||||
|
// set the server to be in a stopping state, otherwise crash detection will kick in and
|
||||||
|
// cause the server to unexpectedly restart on the user.
|
||||||
|
if s.State == ProcessStartingState || s.State == ProcessRunningState {
|
||||||
|
if s.processConfiguration.Stop.Type == api.ProcessStopCommand && data == s.processConfiguration.Stop.Value {
|
||||||
|
s.SetState(ProcessStoppingState)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user