Browse Source

En cours de développement

master
losyme 2 months ago
parent
commit
8e977b8769
  1. 5
      workers/worker.go

5
workers/worker.go

@ -8,6 +8,7 @@ package workers
import (
"fmt"
"runtime/debug"
"sync"
"time"
@ -75,7 +76,7 @@ func (w *worker) updateJob(job *jw.Job, logger Logger) {
logger.Info( //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
"END",
"status", job.Status,
"run_after", job.RunAfter.Round(time.Second).String(),
"run_after", job.RunAfter.String(),
"attempt", fmt.Sprintf("%d/%d", job.Attempt, job.MaxAttempts),
)
} else {
@ -89,7 +90,7 @@ func (w *worker) updateJob(job *jw.Job, logger Logger) {
func (w *worker) maybeRunJob() time.Duration {
defer func() {
if data := recover(); data != nil {
w.logger.Fatal("PANIC ERROR RECOVERED", "data", data) //::::::::::::::::::::::::::::::::::::::::::::::::::::
w.logger.Fatal("PANIC ERROR RECOVERED", "data", data, "stack", string(debug.Stack())) //::::::::::::::::::::
w.stop()
}
}()

Loading…
Cancel
Save