2
0
Fork 0

chore(app): log task errors locally

This commit is contained in:
Luca 2024-05-10 18:01:36 +02:00
parent ccf9728200
commit ff7282ea3b
1 changed files with 2 additions and 0 deletions

View File

@ -32,6 +32,7 @@ def send_messages():
for msg in send(msg.as_outbound() for msg in msgs if not msg.sent_at): for msg in send(msg.as_outbound() for msg in msgs if not msg.sent_at):
sent_msg_ids.append(msg.key) sent_msg_ids.append(msg.key)
except Exception as e: except Exception as e:
logger.error(e)
sentry_sdk.capture_exception(e) sentry_sdk.capture_exception(e)
Message.objects.select_for_update().filter(id__in=sent_msg_ids).update( Message.objects.select_for_update().filter(id__in=sent_msg_ids).update(
@ -81,4 +82,5 @@ def send_reminders():
try: try:
reg.send_reminder() reg.send_reminder()
except Exception as e: except Exception as e:
logger.error(e)
sentry_sdk.capture_exception(e) sentry_sdk.capture_exception(e)