Flamenco/internal/worker/state_restart.go
Sybren A. Stüvel 3e72391cbf Restartable workers
When the worker is started with `-restart-exit-code 47` or has
`restart_exit_code=47` in `flamenco-worker.yaml`, it's marked as
'restartable'. This will enable two worker actions 'Restart
(immediately)' and 'Restart (after task is finished)' in the Manager web
interface. When a worker is asked to restart, it will exit with exit
code `47`. Of course any positive exit code can be used here.
2023-08-14 16:00:09 +02:00

18 lines
304 B
Go

package worker
// SPDX-License-Identifier: GPL-3.0-or-later
import (
"context"
"projects.blender.org/studio/flamenco/pkg/api"
)
func (w *Worker) gotoStateRestart(ctx context.Context) {
w.stateMutex.Lock()
defer w.stateMutex.Unlock()
w.state = api.WorkerStatusRestart
w.requestShutdown(true)
}