From ab3990b90a07aa418c24ef69a60eb5b63ac4db32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Budai?= Date: Thu, 16 Dec 2021 13:20:22 +0100 Subject: [PATCH] dbjobqueue: fix FinishJob not returning an error if already finished MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reported by covscan Signed-off-by: Ondřej Budai --- internal/jobqueue/dbjobqueue/dbjobqueue.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/jobqueue/dbjobqueue/dbjobqueue.go b/internal/jobqueue/dbjobqueue/dbjobqueue.go index 7a3cb2542..e13769e37 100644 --- a/internal/jobqueue/dbjobqueue/dbjobqueue.go +++ b/internal/jobqueue/dbjobqueue/dbjobqueue.go @@ -321,7 +321,7 @@ func (q *DBJobQueue) FinishJob(id uuid.UUID, result interface{}) error { var started, finished *time.Time var jobType string canceled := false - err = conn.QueryRow(context.Background(), sqlQueryJob, id).Scan(&jobType, nil, &started, nil, &canceled) + err = conn.QueryRow(context.Background(), sqlQueryJob, id).Scan(&jobType, nil, &started, &finished, &canceled) if err == pgx.ErrNoRows { return jobqueue.ErrNotExist }