Potential fix for servers being marked as stopping after being marked as offline

This commit is contained in:
Matthew Penner
2021-01-07 19:32:15 -07:00
parent 1d36811dfe
commit 66c9be357c
2 changed files with 8 additions and 4 deletions

View File

@@ -64,9 +64,11 @@ func (s *Server) StartEventListeners() {
// to terminate again.
if s.Environment.State() != environment.ProcessStoppingState {
s.Environment.SetState(environment.ProcessStoppingState)
go func() {
s.Log().Warn("stopping server instance, violating throttle limits")
s.PublishConsoleOutputFromDaemon("Your server is being stopped for outputting too much data in a short period of time.")
// Completely skip over server power actions and terminate the running instance. This gives the
// server 15 seconds to finish stopping gracefully before it is forcefully terminated.
if err := s.Environment.WaitForStop(config.Get().Throttles.StopGracePeriod, true); err != nil {