Skip to content

added handling to put the save_email task on a separate queue - ten…#4784

Draft
rparke wants to merge 1 commit intomainfrom
rp-add-queue-for-sendfiles-by-email-process-job-row
Draft

added handling to put the save_email task on a separate queue - ten…#4784
rparke wants to merge 1 commit intomainfrom
rp-add-queue-for-sendfiles-by-email-process-job-row

Conversation

@rparke
Copy link
Contributor

@rparke rparke commented Mar 18, 2026

…tatively called database-files-tasks

this still needs testing to ensure that jobs for a template that has files are called with the correct arguments and put onto the correct queue

(database-files-tasks is an utterly unhelpful name even if it IS consistent with our naming. I welcome better names)

…tatively called `database-files-tasks`

this still needs testing to ensure that jobs for a template that has files are called with the correct arguments and put onto the correct queue

(`database-files-tasks` is an utterly unhelpful name even if it IS consistent with our naming. I welcome better names)
Copy link
Contributor

@CrystalPea CrystalPea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a few comments - will review again when there are tests 🙌🏼

extra = {"job_row_number": row_to_process.missing_row, "job_id": job.id}
current_app.logger.info("Processing missing row %(job_row_number)s for job %(job_id)s", extra, extra=extra)
process_job_row(template.template_type, task_args_kwargs)
process_job_row(template.template_type, task_args_kwargs, send_file_by_ui=False)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it's a job it's always by ui, the name for the variable could be with_email_file maybe?


recipient_csv, template, sender_id = get_recipient_csv_and_template_and_sender_id(job)

from app.dao.template_email_files_dao import dao_get_template_email_files_by_template_id
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the import here to avoid circular imports?

for row in shatter_batch
]
_shatter_job_rows_with_subdivision(template.template_type, batch_args_kwargs)
_shatter_job_rows_with_subdivision(template.template_type, batch_args_kwargs, send_file_via_ui=send_file_via_ui)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we add the new arg to batch_args_kwargs? Since that's where almost all other args live? Then we can avoid passing it in so many places 🙌🏼

if send_file_by_ui:
send_fn.apply_async(
*task_args_kwargs,
queue=QueueNames.DATABASE_FILES,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the queue name could be jobs_with_email_files_tasks, and then the const for it could be JOBS_WITH_EMAIL_FILES, since this is the only thing that will go on that queue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants