Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenneth Kehl committed Jan 13, 2025
1 parent 238ec27 commit f9641ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/celery/scheduled_tasks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import json
from datetime import timedelta
from datetime import datetime, timedelta

from flask import current_app
from sqlalchemy import between
Expand Down Expand Up @@ -324,7 +324,7 @@ def batch_insert_notifications(self):
current_app.logger.exception("Notification batch insert failed")
for n in batch:
# Use 'created_at' as a TTL so we don't retry infinitely
if n.created_at < utc_now() - timedelta(minutes=1):
if datetime.fromisoformat(n.created_at) < utc_now() - timedelta(minutes=1):
current_app.logger.warning(
f"Abandoning stale data, could not write to db: {n.serialize_for_redis(n)}"
)
Expand Down

0 comments on commit f9641ae

Please sign in to comment.