add job name to event listners (#621)

* add job name to event listners

* missed the examples

* missed executor
This commit is contained in:
John Roesler
2023-11-14 11:39:27 -06:00
committed by GitHub
parent 66caa1aabe
commit 8c628fae2d
5 changed files with 25 additions and 25 deletions
+3 -3
View File
@@ -344,7 +344,7 @@ func (e *executor) runJob(j internalJob) {
}
defer func() { _ = lock.Unlock(j.ctx) }()
}
_ = callJobFuncWithParams(j.beforeJobRuns, j.id)
_ = callJobFuncWithParams(j.beforeJobRuns, j.id, j.name)
select {
case <-e.ctx.Done():
@@ -356,8 +356,8 @@ func (e *executor) runJob(j internalJob) {
err := callJobFuncWithParams(j.function, j.parameters...)
if err != nil {
_ = callJobFuncWithParams(j.afterJobRunsWithError, j.id, err)
_ = callJobFuncWithParams(j.afterJobRunsWithError, j.id, j.name, err)
} else {
_ = callJobFuncWithParams(j.afterJobRuns, j.id)
_ = callJobFuncWithParams(j.afterJobRuns, j.id, j.name)
}
}