Skip to content

Conversation

thomasleese
Copy link
Contributor

This splits the jobs in to two separate jobs each, one which runs on a schedule and for each session queues up a separate job which handles the process of sending the communications for a particular session.

We're finding that the current job is unable to handle a high number of sessions and runs out of resources. Instead, by queuing a job for each session we can avoid the individual jobs being too resource hungry and gives us more flexibility in terms of running the jobs manually.

As part of this change I've also renamed the other jobs for consistency, specifically jobs which are prefixed with Enqueue do nothing other than queue up other jobs, and jobs prefixed with Send do the task of actually sending out communications.

@thomasleese thomasleese added the refactor Improving maintainability label Apr 7, 2025
@thomasleese thomasleese added this to the v2.1.3 milestone Apr 7, 2025
@thomasleese thomasleese force-pushed the refactor-enqueue-jobs branch from aca1638 to b7813df Compare April 7, 2025 06:14
@benilovj benilovj modified the milestones: v2.1.3, v2.2.0 Apr 7, 2025
@thomasleese thomasleese modified the milestones: v2.2.0, v2.2.1 Apr 8, 2025
Base automatically changed from v2.1.3-wip to main April 8, 2025 08:05
@thomasleese thomasleese force-pushed the refactor-enqueue-jobs branch from b7813df to df77617 Compare April 8, 2025 16:10
@thomasleese thomasleese modified the milestones: v2.2.0, v2.2.1, v2.3.0 Apr 9, 2025
@thomasleese thomasleese force-pushed the refactor-enqueue-jobs branch from df77617 to 15272af Compare April 9, 2025 14:40
@tvararu tvararu temporarily deployed to mavis-pr-3328 April 9, 2025 14:41 Inactive
@thomasleese thomasleese modified the milestones: v2.3.0, v2.2.0 Apr 9, 2025
@thomasleese thomasleese force-pushed the refactor-enqueue-jobs branch 2 times, most recently from 7edeb3b to c466686 Compare April 15, 2025 11:05
@thomasleese thomasleese changed the base branch from main to v2.2.0-wip April 15, 2025 11:05
To `SendVaccinationConfirmationsJob` to match the naming convention with
the other jobs that send out communications.
To `EnqueueUpdatePatientsFromPDSJob` as this is the naming convention
we'll use for jobs which do nothing but queue up other jobs.
To `EnqueueClinicSessionInvitationsJob` as this better reflects that the
job is only responsible for enqueing other jobs.
To `SendSchoolSessionRemindersJob` to reflect that this job actually
sends the communications rather than just enqueing other jobs.
This splits the job in to two separate jobs, one which runs on a
schedule and for each session queues up a separate job which handles the
process of sending the communications for a particular session.

We're finding that the current job is unable to handle a high number of
sessions and runs out of resources. Instead, by queuing a job for each
session we can avoid the individual jobs being too resource hungry and
gives us more flexibility in terms of running the jobs manually.
This splits the job in to two separate jobs, one which runs on a
schedule and for each session queues up a separate job which handles the
process of sending the communications for a particular session.

We're finding that the current job is unable to handle a high number of
sessions and runs out of resources. Instead, by queuing a job for each
session we can avoid the individual jobs being too resource hungry and
gives us more flexibility in terms of running the jobs manually.
@thomasleese thomasleese force-pushed the refactor-enqueue-jobs branch from c466686 to 330bd08 Compare April 15, 2025 11:26
Copy link

sonarqubecloud bot commented Apr 15, 2025

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@thomasleese thomasleese merged commit e8b976e into v2.2.0-wip Apr 16, 2025
13 checks passed
@thomasleese thomasleese deleted the refactor-enqueue-jobs branch April 16, 2025 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Improving maintainability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants