added handling to put the save_email task on a separate queue - ten…#4784
Draft
added handling to put the save_email task on a separate queue - ten…#4784
save_email task on a separate queue - ten…#4784Conversation
…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)
CrystalPea
reviewed
Mar 19, 2026
Contributor
CrystalPea
left a comment
There was a problem hiding this comment.
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) |
Contributor
There was a problem hiding this comment.
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 |
Contributor
There was a problem hiding this comment.
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) |
Contributor
There was a problem hiding this comment.
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, |
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…tatively called
database-files-tasksthis 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-tasksis an utterly unhelpful name even if it IS consistent with our naming. I welcome better names)