From f9641aee39d1885507f9048acf9ba2905afa30ab Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Mon, 13 Jan 2025 11:00:42 -0800 Subject: [PATCH] more tests --- app/celery/scheduled_tasks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/celery/scheduled_tasks.py b/app/celery/scheduled_tasks.py index a60551b75..ec134c697 100644 --- a/app/celery/scheduled_tasks.py +++ b/app/celery/scheduled_tasks.py @@ -1,5 +1,5 @@ import json -from datetime import timedelta +from datetime import datetime, timedelta from flask import current_app from sqlalchemy import between @@ -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)}" )