Skip to content

Commit 4098856

Browse files
corlettbjoybytes
authored andcommitted
Fix SES stub logging TypeError in Celery workers.
The error from the logs was: `TypeError: not all arguments converted during string formatting` Changing to pass duration metadata via extra={...} to preserve structured logging.
1 parent 47e1d06 commit 4098856

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/clients/email/aws_ses_stub.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def send_email(
4949
else:
5050
elapsed_time = monotonic() - start_time
5151
current_app.logger.info(
52-
"AWS SES stub request finished in %.4g seconds", elapsed_time, {"duration": elapsed_time}
52+
"AWS SES stub request finished in %.4g seconds", elapsed_time, extra={"duration": elapsed_time}
5353
)
5454
self.statsd_client.timing("clients.ses_stub.request-time", elapsed_time)
5555
self.statsd_client.incr("clients.ses_stub.success")

0 commit comments

Comments
 (0)