Skip to content

Commit

Permalink
fix overly greedy panic handler (#800)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnRoesler authored Nov 20, 2024
1 parent 31de1e8 commit dec269f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,12 @@ func (e *executor) runJob(j internalJob, jIn jobIn) {
}

startTime := time.Now()
err := e.callJobWithRecover(j)
var err error
if j.afterJobRunsWithPanic != nil {
err = e.callJobWithRecover(j)
} else {
err = callJobFuncWithParams(j.function, j.parameters...)
}
e.recordJobTiming(startTime, time.Now(), j)
if err != nil {
_ = callJobFuncWithParams(j.afterJobRunsWithError, j.id, j.name, err)
Expand Down

0 comments on commit dec269f

Please sign in to comment.