From 30a58526852b80a13579f04d10880f817510cc92 Mon Sep 17 00:00:00 2001 From: Rebecca Law Date: Wed, 17 Nov 2021 14:46:52 +0000 Subject: [PATCH] Update the query to only return the count from the table since that is all we care about. https://www.pivotaltracker.com/story/show/180262357 --- app/dao/notifications_dao.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/dao/notifications_dao.py b/app/dao/notifications_dao.py index e5b61e3d7..b7047c989 100644 --- a/app/dao/notifications_dao.py +++ b/app/dao/notifications_dao.py @@ -398,14 +398,14 @@ def insert_notification_history_delete_notifications( select_to_use = select_into_temp_table_for_letters if notification_type == 'letter' else select_into_temp_table db.session.execute(select_to_use, input_params) - result = db.session.execute("select * from NOTIFICATION_ARCHIVE") + result = db.session.execute("select count(*) from NOTIFICATION_ARCHIVE").fetchone()[0] db.session.execute(insert_query) db.session.execute(delete_query) db.session.execute("DROP TABLE NOTIFICATION_ARCHIVE") - return result.rowcount + return result def _move_notifications_to_notification_history(notification_type, service_id, day_to_delete_backwards_from, qry_limit):