mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 15:15:38 -05:00
Allow 20 minutes before checking for missing rows
Since we’ve doubled the number of rows in a job, jobs can take twice as long to insert all the notifications. We don’t check for missing rows until we’re pretty confident that the original tasks have finished processing. This means we need to double the time we wait to still be as sure.
This commit is contained in:
@@ -209,9 +209,9 @@ def can_letter_job_be_cancelled(job):
|
||||
|
||||
|
||||
def find_jobs_with_missing_rows():
|
||||
# Jobs can be a maximum of 50,000 rows. It typically takes 5 minutes to create all those notifications.
|
||||
# Using 10 minutes as a condition seems reasonable.
|
||||
ten_minutes_ago = datetime.utcnow() - timedelta(minutes=10)
|
||||
# Jobs can be a maximum of 100,000 rows. It typically takes 10 minutes to create all those notifications.
|
||||
# Using 20 minutes as a condition seems reasonable.
|
||||
ten_minutes_ago = datetime.utcnow() - timedelta(minutes=20)
|
||||
yesterday = datetime.utcnow() - timedelta(days=1)
|
||||
jobs_with_rows_missing = db.session.query(
|
||||
func.count(Notification.id).label('actual_count'),
|
||||
|
||||
Reference in New Issue
Block a user