diff --git a/internal/manager/api_impl/workers.go b/internal/manager/api_impl/workers.go index 6b2d5bd1..f648063d 100644 --- a/internal/manager/api_impl/workers.go +++ b/internal/manager/api_impl/workers.go @@ -149,7 +149,7 @@ func (f *Flamenco) SignOff(e echo.Context) error { w := requestWorkerOrPanic(e) prevStatus := w.Status w.Status = api.WorkerStatusOffline - if w.StatusRequested == api.WorkerStatusShutdown { + if w.StatusRequested == api.WorkerStatusOffline { w.StatusRequested = "" } diff --git a/internal/worker/state_shutdown.go b/internal/worker/state_offline.go similarity index 84% rename from internal/worker/state_shutdown.go rename to internal/worker/state_offline.go index 15eafe2e..df998e96 100644 --- a/internal/worker/state_shutdown.go +++ b/internal/worker/state_offline.go @@ -11,11 +11,11 @@ import ( "git.blender.org/flamenco/pkg/api" ) -func (w *Worker) gotoStateShutdown(context.Context) { +func (w *Worker) gotoStateOffline(context.Context) { w.stateMutex.Lock() defer w.stateMutex.Unlock() - w.state = api.WorkerStatusShutdown + w.state = api.WorkerStatusOffline logger := log.With().Int("pid", os.Getpid()).Logger() proc, err := os.FindProcess(os.Getpid()) @@ -26,7 +26,7 @@ func (w *Worker) gotoStateShutdown(context.Context) { logger.Warn().Msg("sending our own process an interrupt signal") err = proc.Signal(os.Interrupt) if err != nil { - logger.Fatal().Err(err).Msg("unable to find send interrupt signal to our own process") + logger.Fatal().Err(err).Msg("unable to send interrupt signal to our own process") } } @@ -34,7 +34,7 @@ func (w *Worker) gotoStateShutdown(context.Context) { // Does NOT actually peform a shutdown; is intended to be called while shutdown is in progress. func (w *Worker) SignOff(ctx context.Context) { w.stateMutex.Lock() - w.state = api.WorkerStatusShutdown + w.state = api.WorkerStatusOffline logger := log.With().Str("state", string(w.state)).Logger() w.stateMutex.Unlock() diff --git a/internal/worker/statemachine.go b/internal/worker/statemachine.go index da4676b0..55c7c5e5 100644 --- a/internal/worker/statemachine.go +++ b/internal/worker/statemachine.go @@ -14,7 +14,7 @@ import ( func (w *Worker) setupStateMachine() { w.stateStarters[api.WorkerStatusAsleep] = w.gotoStateAsleep w.stateStarters[api.WorkerStatusAwake] = w.gotoStateAwake - w.stateStarters[api.WorkerStatusShutdown] = w.gotoStateShutdown + w.stateStarters[api.WorkerStatusOffline] = w.gotoStateOffline } // Called whenever the Flamenco Manager has a change in current status for us.