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:
Sybren A. Stüvel 2022-06-16 10:46:50 +02:00
parent 40f711bf69
commit ee53373878

View File

@ -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)).