Skip to content

Commit

Permalink
fix: task queue misaligned issue
Browse files Browse the repository at this point in the history
  • Loading branch information
tikazyq committed Apr 5, 2023
1 parent 8b7ee05 commit 0a348c8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion task/handler/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ func (svc *Service) Fetch() {
// run task
if err := svc.run(tid); err != nil {
trace.PrintError(err)
t, err := svc.GetTaskById(tid)
if err == nil {
t.SetError(err.Error())
_ = svc.SaveTask(t, constants.TaskStatusError)
continue
}
continue
}
}
Expand Down Expand Up @@ -360,7 +366,7 @@ func (svc *Service) run(taskId primitive.ObjectID) (err error) {
// create a new task runner
r, err := NewTaskRunner(taskId, svc)
if err != nil {
return err
return trace.TraceError(err)
}

// add runner to pool
Expand Down

0 comments on commit 0a348c8

Please sign in to comment.