fsjobqueue: make canceling a finished job an error

This mirrors FinishJob(), which also errors when the job is already
finished.
This commit is contained in:
Lars Karlitski 2021-01-05 23:21:48 +01:00 committed by Tom Gundersen
parent 30492bfc60
commit 871c6e9cbb
2 changed files with 4 additions and 3 deletions

View file

@ -298,7 +298,7 @@ func (q *fsJobQueue) CancelJob(id uuid.UUID) error {
}
if !j.FinishedAt.IsZero() {
return nil
return jobqueue.ErrNotRunning
}
j.Canceled = true