From 6155f7666e05f322e21e484e9f96778dc3ed36c2 Mon Sep 17 00:00:00 2001 From: Rebecca Law Date: Wed, 13 Nov 2019 13:40:42 +0000 Subject: [PATCH] Testing with latest --- app/celery/scheduled_tasks.py | 5 +---- app/celery/tasks.py | 4 +--- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/app/celery/scheduled_tasks.py b/app/celery/scheduled_tasks.py index 12949a436..5702004e5 100644 --- a/app/celery/scheduled_tasks.py +++ b/app/celery/scheduled_tasks.py @@ -239,12 +239,9 @@ def check_for_missing_rows_in_completed_jobs(): job = x[1] missing_rows = find_missing_row_for_job(job.id, job.notification_count) for row_to_process in missing_rows: - # The sender_id is passed in with job, at this point we no longer have the sender that is passed in. - # The notification will be created with the default sender. - # There is a bug to fix this https://www.pivotaltracker.com/story/show/169569144 recipient_csv, template, sender_id = get_recipient_csv_and_template_and_sender_id(job) for row in recipient_csv.get_rows(): if row.index == row_to_process.missing_row: - current_app.logger.info( + current_app.logger( "Processing missing row: {} for job: {}".format(row_to_process.missing_row, job.id)) process_row(row, template, job, job.service, sender_id=sender_id) diff --git a/app/celery/tasks.py b/app/celery/tasks.py index 1b30093e2..588e14054 100644 --- a/app/celery/tasks.py +++ b/app/celery/tasks.py @@ -27,7 +27,6 @@ from app import ( notify_celery, ) from app.aws import s3 -from app.aws.s3 import get_job_and_metadata_from_s3 from app.celery import provider_tasks, letters_pdf_tasks, research_mode_tasks from app.config import QueueNames from app.dao.daily_sorted_letter_dao import dao_create_or_update_daily_sorted_letter @@ -98,7 +97,6 @@ def process_job(job_id, sender_id=None): job.processing_started = start dao_update_job(job) - # should I rename the variable? recipient_csv, template, sender_id = get_recipient_csv_and_template_and_sender_id(job) current_app.logger.info("Starting job {} processing {} notifications".format(job_id, job.notification_count)) @@ -131,7 +129,7 @@ def get_recipient_csv_and_template_and_sender_id(job): TemplateClass = get_template_class(db_template.template_type) template = TemplateClass(db_template.__dict__) - contents, meta_data = get_job_and_metadata_from_s3(service_id=str(job.service_id), job_id=str(job.id)) + contents, meta_data = s3.get_job_and_metadata_from_s3(service_id=str(job.service_id), job_id=str(job.id)) recipient_csv = RecipientCSV(file_data=contents, template_type=template.template_type, placeholders=template.placeholders)