Cleanup: compare worker state to constant instead of hard-coded state
Use the `requiredStatusToGetTask` constant to compare the worker status, and not just for logging. No functional changes, just better code.
This commit is contained in:
parent
40f711bf69
commit
ee53373878
@ -273,7 +273,7 @@ func (f *Flamenco) ScheduleTask(e echo.Context) error {
|
||||
|
||||
// Check that this worker is actually allowed to do work.
|
||||
requiredStatusToGetTask := api.WorkerStatusAwake
|
||||
if worker.Status != api.WorkerStatusAwake {
|
||||
if worker.Status != requiredStatusToGetTask {
|
||||
logger.Warn().
|
||||
Str("workerStatus", string(worker.Status)).
|
||||
Str("requiredStatus", string(requiredStatusToGetTask)).
|
||||
|
Loading…
x
Reference in New Issue
Block a user