Skip to content

Commit

Permalink
Refactor handler in process.go to improve error handling and resource…
Browse files Browse the repository at this point in the history
… management; replace Exec with Execute method and add deferred resource release
  • Loading branch information
trheyi committed Dec 10, 2024
1 parent f810f2e commit 5012437
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion schedule/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,11 @@ func (sch *Schedule) handler() (func(), error) {
log.Error("[Schedule] %s %s %s", sch.name, sch.Process, err)
}

_, err = p.Exec()
err = p.Execute()
if err != nil {
log.Error("[Schedule] %s %s %s", sch.name, sch.Process, err)
}
defer p.Release()
}, nil
}

Expand Down

0 comments on commit 5012437

Please sign in to comment.