mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 15:31:15 -05:00
fix nightly ft stats tables task to respect BST
the create_nightly_notification_status task runs at 00:30am UK time, however this means that in summer datetime.today() will return the wrong date as the server (which runs on UTC) will run the task at 23:30 (populating the wrong row in the table). fix this to use nice tz aware functions
This commit is contained in:
@@ -54,11 +54,11 @@ def fetch_notification_status_for_day(process_day, service_id=None):
|
||||
def update_fact_notification_status(data, process_day):
|
||||
table = FactNotificationStatus.__table__
|
||||
FactNotificationStatus.query.filter(
|
||||
FactNotificationStatus.bst_date == process_day.date()
|
||||
FactNotificationStatus.bst_date == process_day
|
||||
).delete()
|
||||
for row in data:
|
||||
stmt = insert(table).values(
|
||||
bst_date=process_day.date(),
|
||||
bst_date=process_day,
|
||||
template_id=row.template_id,
|
||||
service_id=row.service_id,
|
||||
job_id=row.job_id,
|
||||
|
||||
Reference in New Issue
Block a user