Improve error messages on notify failures

This commit is contained in:
Eli Ribble 2026-03-19 21:29:20 +00:00
parent 6042e7d337
commit cb34c43ef4
No known key found for this signature in database

View file

@ -156,7 +156,7 @@ func listenAndDoOneJob(ctx context.Context) error {
_, err = conn.Exec(ctx, "LISTEN new_job")
if err != nil {
//if !pgconn.Timeout(err) {
return fmt.Errorf("failed to listen to outbound_email_queued: %w", err)
return fmt.Errorf("failed to execute 'LISTEN new_job': %w", err)
}
for {
@ -164,7 +164,7 @@ func listenAndDoOneJob(ctx context.Context) error {
notification, err := conn.Conn().WaitForNotification(ctx)
if err != nil {
//if !pgconn.Timeout(err) {
return fmt.Errorf("failed while waiting for notification of outbound_email_queued")
return fmt.Errorf("failed while waiting for notification of new job: %w", err)
}
job_id, err := strconv.Atoi(notification.Payload)