dbjobqueue: fix FinishJob not returning an error if already finished

Reported by covscan

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit is contained in:
Ondřej Budai 2021-12-16 13:20:22 +01:00 committed by Tom Gundersen
parent 2543459a7f
commit ab3990b90a

View file

@ -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
}