rework locker + fix job state + fix graceful stop
This commit is contained in:
+4
-2
@@ -59,7 +59,6 @@ type JobDetails struct {
|
||||
Err string `json:"error"`
|
||||
}
|
||||
|
||||
// TODO(rmanach): add priority level
|
||||
type Job struct {
|
||||
l sync.RWMutex
|
||||
id uuid.UUID
|
||||
@@ -130,7 +129,10 @@ func (j *Job) setFail(err error) {
|
||||
now := time.Now().UTC()
|
||||
j.updatedAt = &now
|
||||
|
||||
j.state = Failed
|
||||
if j.state != Abort {
|
||||
j.state = Failed
|
||||
}
|
||||
|
||||
j.err = err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user