Don't abort entire boot process due to one bad server egg; closes pterodactyl/panel#2448

This commit is contained in:
Dane Everitt
2020-10-17 12:06:47 -07:00
parent ad1ed0f24a
commit 947279a07c
6 changed files with 34 additions and 26 deletions

View File

@@ -33,13 +33,11 @@ func (e *Environment) SendCommand(c string) error {
e.mu.RLock()
defer e.mu.RUnlock()
if e.meta.Stop != nil {
// If the command being processed is the same as the process stop command then we want to mark
// the server as entering the stopping state otherwise the process will stop and Wings will think
// it has crashed and attempt to restart it.
if e.meta.Stop.Type == "command" && c == e.meta.Stop.Value {
e.Events().Publish(environment.StateChangeEvent, environment.ProcessStoppingState)
}
// If the command being processed is the same as the process stop command then we want to mark
// the server as entering the stopping state otherwise the process will stop and Wings will think
// it has crashed and attempt to restart it.
if e.meta.Stop.Type == "command" && c == e.meta.Stop.Value {
e.Events().Publish(environment.StateChangeEvent, environment.ProcessStoppingState)
}
_, err := e.stream.Conn.Write([]byte(c + "\n"))