fix: always start job in exec handler

makes sure that if any errors occur the job
will still throw the start hook
extended-job-api
TorchedSammy 2022-05-13 16:59:16 -04:00
parent 9a87d76969
commit 3374dfd28f
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
1 changed files with 1 additions and 4 deletions

View File

@ -362,12 +362,9 @@ func execHandle(bg bool) interp.ExecHandlerFunc {
if bg {
j = jobs.getLatest()
j.setHandle(cmd.Process)
}
if err == nil {
if bg {
j.start(cmd.Process.Pid)
}
if err == nil {
if done := ctx.Done(); done != nil {
go func() {
<-done