From a9d901da719e508e5c303abce8d271c83c3e38d7 Mon Sep 17 00:00:00 2001 From: Samuel Lorch Date: Sat, 6 Jul 2024 03:08:58 +0200 Subject: [PATCH] Also Count Unkown Tasks as Assigned --- server/task.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/task.go b/server/task.go index 8161ca1..4d430a1 100644 --- a/server/task.go +++ b/server/task.go @@ -358,7 +358,7 @@ func assignQueuedTasks(ctx context.Context) error { } if Workers[i].Connected { var count int - err := db.QueryRow(ctx, "SELECT COUNT(*) FROM tasks WHERE worker_id = $1 AND (status = $2 OR status = $3 OR status = $4)", i, constants.TASK_STATUS_ASSIGNED, constants.TASK_STATUS_RUNNING, constants.TASK_STATUS_WAITING).Scan(&count) + err := db.QueryRow(ctx, "SELECT COUNT(*) FROM tasks WHERE worker_id = $1 AND (status = $2 OR status = $3 OR status = $4 OR status = $5)", i, constants.TASK_STATUS_UNKNOWN, constants.TASK_STATUS_ASSIGNED, constants.TASK_STATUS_RUNNING, constants.TASK_STATUS_WAITING).Scan(&count) if err != nil { return fmt.Errorf("Error Querying Worker Task Count: %w", err) }