mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 10:21:14 -05:00
Removed the end date in the filter.
It's always going to be in the future anyway. After some analysis the query does perform better without it. I'll make a note to update other queries where we get todays notification data to remove the end date filter in a separate PR.
This commit is contained in:
@@ -431,10 +431,8 @@ def dao_fetch_stats_for_service(service_id, limit_days):
|
|||||||
def dao_fetch_todays_stats_for_service(service_id):
|
def dao_fetch_todays_stats_for_service(service_id):
|
||||||
today = date.today()
|
today = date.today()
|
||||||
start_date = get_london_midnight_in_utc(today)
|
start_date = get_london_midnight_in_utc(today)
|
||||||
end_date = get_london_midnight_in_utc(today + timedelta(days=1))
|
|
||||||
return _stats_for_service_query(service_id).filter(
|
return _stats_for_service_query(service_id).filter(
|
||||||
Notification.created_at >= start_date,
|
Notification.created_at >= start_date
|
||||||
Notification.created_at < end_date
|
|
||||||
).all()
|
).all()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user