Fix state retrevial race condition

This commit is contained in:
Dane Everitt 2020-09-12 09:12:30 -07:00
parent fa6f56caa8
commit 8407ea21da
No known key found for this signature in database
GPG Key ID: EEA66103B3D71F53

View File

@ -78,8 +78,8 @@ func (s *Server) SetState(state string) error {
// Emit the event to any listeners that are currently registered.
if prevState != state {
s.Log().WithField("status", s.Proc().State).Debug("saw server status change event")
s.Events().Publish(StatusEvent, s.Proc().State)
s.Log().WithField("status", s.Proc().getInternalState()).Debug("saw server status change event")
s.Events().Publish(StatusEvent, s.Proc().getInternalState())
}
// Persist this change to the disk immediately so that should the Daemon be stopped or