Suppress errors from canceled context on DB notification goroutine

This commit is contained in:
Eli Ribble 2026-04-28 22:24:15 +00:00
parent a5b9ee0c6c
commit a101ff3cc9
No known key found for this signature in database

View file

@ -166,6 +166,10 @@ func listenAndDoOneJob(ctx context.Context) error {
notification, err := conn.Conn().WaitForNotification(ctx)
if err != nil {
//if !pgconn.Timeout(err) {
if err2 := ctx.Err(); err2 != nil {
log.Info().Err(err2).Msg("DB notification context err")
return nil
}
return fmt.Errorf("failed while waiting for notification of new job: %w", err)
}