From ee53373878f10a7b55194d1b12057b9d698e2855 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 16 Jun 2022 10:46:50 +0200 Subject: [PATCH] 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. --- internal/manager/api_impl/workers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/manager/api_impl/workers.go b/internal/manager/api_impl/workers.go index e9cef72a..0cb5741b 100644 --- a/internal/manager/api_impl/workers.go +++ b/internal/manager/api_impl/workers.go @@ -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)).