mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 07:21:13 -05:00
base job start of processing_started rather than created_at
otherwise scheduled jobs will be viewed as old, and we'll pull stats from the statistics tables, even if they might have not even started yet
This commit is contained in:
@@ -173,8 +173,12 @@ def get_paginated_jobs(service_id, limit_days, statuses, page):
|
||||
)
|
||||
data = job_schema.dump(pagination.items, many=True).data
|
||||
for job_data in data:
|
||||
created_at = dateutil.parser.parse(job_data['created_at']).replace(tzinfo=None)
|
||||
if created_at < midnight_n_days_ago(3):
|
||||
start = job_data['processing_started']
|
||||
start = dateutil.parser.parse(start).replace(tzinfo=None) if start else None
|
||||
|
||||
if start is None:
|
||||
statistics = []
|
||||
elif start.replace(tzinfo=None) < midnight_n_days_ago(3):
|
||||
# ft_notification_status table
|
||||
statistics = fetch_notification_statuses_for_job(job_data['id'])
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user