Skip to content

Commit

Permalink
Scheduler: improve message when task is recovered.
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Nov 14, 2023
1 parent 1f2c245 commit ccee82c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scheduler/tasks/runnable.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,9 @@ func (r *Runnable) RunAction(queue chan RunnerFunc) {
if re := recover(); re != nil {
r.Task.SetStatus(jobs.TaskStatus_Error, "Panic inside task")
if e, ok := re.(error); ok {
log.TasksLogger(r.Context).Error("Recovered scheduler task", zap.Any("task", r.Task), zap.Error(e))
log.Logger(r.Context).Error("Recovered scheduler task", zap.Any("task", r.Task), zap.Error(e))
r.Task.SetStatus(jobs.TaskStatus_Error, "Panic inside task: "+e.Error())
log.TasksLogger(r.Context).Error("Recovered scheduler task "+r.Action.ID, zap.Any("input", r.Message), zap.Error(e))
log.Logger(r.Context).Error("Recovered scheduler task "+r.Action.ID, zap.Error(e))
r.Task.SetError(e, true)
}
r.Task.Save()
Expand Down

0 comments on commit ccee82c

Please sign in to comment.