Better race condition prevention

This commit is contained in:
Dane Everitt
2020-04-10 18:22:18 -07:00
parent 17d204a631
commit 03045c94be
9 changed files with 99 additions and 81 deletions

View File

@@ -102,7 +102,7 @@ func (s *Server) runBackgroundActions() {
// Check if the server is now suspended, and if so and the process is not terminated
// yet, do it immediately.
go func(server *Server) {
if server.Suspended && server.State != ProcessOfflineState {
if server.Suspended && server.GetState() != ProcessOfflineState {
zap.S().Infow("server suspended with running process state, terminating now", zap.String("server", server.Uuid))
/*if err := server.Environment.Terminate(os.Kill); err != nil {