From 59bbb4f8b7b92bc317b537a437a79e2be42df848 Mon Sep 17 00:00:00 2001 From: Ben Thorner Date: Mon, 22 Nov 2021 12:41:26 +0000 Subject: [PATCH] Remove redundant filters in timeout update query These aren't necessary since we're locking the set of notifications to update, which are queried using the same filters. --- app/dao/notifications_dao.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/dao/notifications_dao.py b/app/dao/notifications_dao.py index 0c93752dd..42166b8ac 100644 --- a/app/dao/notifications_dao.py +++ b/app/dao/notifications_dao.py @@ -474,9 +474,6 @@ def _timeout_notifications(current_statuses, new_status, timeout_start, updated_ ).all() Notification.query.filter( - Notification.created_at < timeout_start, - Notification.status.in_(current_statuses), - Notification.notification_type.in_([SMS_TYPE, EMAIL_TYPE]), Notification.id.in_([n.id for n in notifications]), ).update( {'status': new_status, 'updated_at': updated_at},