mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-16 20:48:37 -04:00
Fix the query.
Missing the where clause to join the two tables.... OOPS
This commit is contained in:
@@ -245,5 +245,5 @@ def check_for_missing_rows_in_completed_jobs():
|
||||
recipient_csv, template = get_recipient_csv_and_template(job)
|
||||
for row in recipient_csv.get_rows():
|
||||
if row.index == row_to_process.missing_row:
|
||||
current_app.logger.info("Processing row: {} for job: {}")
|
||||
current_app.logger.info("Processing missing row: {} for job: {}")
|
||||
process_row(row, template, job, job.service)
|
||||
|
||||
@@ -195,11 +195,12 @@ def find_jobs_with_missing_rows():
|
||||
# Using 10 minutes as a condition seems reasonable.
|
||||
ten_minutes_ago = datetime.utcnow() - timedelta(minutes=10)
|
||||
jobs_with_rows_missing = db.session.query(
|
||||
func.count(Notification.id).label('count_notifications'),
|
||||
func.count(Notification.id).label('actual_count'),
|
||||
Job
|
||||
).filter(
|
||||
Job.job_status == JOB_STATUS_FINISHED,
|
||||
Job.processing_finished < ten_minutes_ago
|
||||
Job.processing_finished < ten_minutes_ago,
|
||||
Job.id == Notification.job_id
|
||||
).group_by(
|
||||
Job
|
||||
).having(
|
||||
|
||||
Reference in New Issue
Block a user