Skip to content
Snippets Groups Projects
Commit 40617257fb17 authored by Christophe de Vienne's avatar Christophe de Vienne
Browse files

MailSender: bail out if context is done

parent f97d71bec55d
No related branches found
No related tags found
No related merge requests found
...@@ -105,6 +105,12 @@ ...@@ -105,6 +105,12 @@
log := zerolog.Ctx(ctx) log := zerolog.Ctx(ctx)
for { for {
if ctx.Err() != nil {
log.Debug().Msg("mailsender: context done, stopping")
return
}
if err := s.handle(ctx, db); err != nil { if err := s.handle(ctx, db); err != nil {
if errors.Is(err, sql.ErrNoRows) { if errors.Is(err, sql.ErrNoRows) {
log.Debug().Msg("no mail in the queue") log.Debug().Msg("no mail in the queue")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment