Gracefully exit listenForJobs when context ends
This commit is contained in:
parent
bad50a8772
commit
bcea3c6bdf
1 changed files with 4 additions and 0 deletions
|
|
@ -127,6 +127,10 @@ func listenForJobs(ctx context.Context) {
|
|||
//es.SendQueuedEmails(ctx) // send any emails queued prior to listening for notificiations
|
||||
err := listenAndDoOneJob(ctx)
|
||||
if err != nil {
|
||||
if err.Error() == "context canceled" {
|
||||
log.Debug().Msg("Exiting listenForJobs")
|
||||
return
|
||||
}
|
||||
log.Error().Err(err).Msg("Crashed listenAndDoOneJob")
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue