Skip to content

Commit dec269f

Browse files
authored
fix overly greedy panic handler (#800)
1 parent 31de1e8 commit dec269f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

executor.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,12 @@ func (e *executor) runJob(j internalJob, jIn jobIn) {
396396
}
397397

398398
startTime := time.Now()
399-
err := e.callJobWithRecover(j)
399+
var err error
400+
if j.afterJobRunsWithPanic != nil {
401+
err = e.callJobWithRecover(j)
402+
} else {
403+
err = callJobFuncWithParams(j.function, j.parameters...)
404+
}
400405
e.recordJobTiming(startTime, time.Now(), j)
401406
if err != nil {
402407
_ = callJobFuncWithParams(j.afterJobRunsWithError, j.id, j.name, err)

0 commit comments

Comments
 (0)