symbiote / silverstripe-queuedjobs

A module that provides interfaces for scheduling jobs for certain times.
BSD 3-Clause "New" or "Revised" License
57 stars 73 forks source link

Validate if broken job emails are being sent #435

Closed emteknetnz closed 1 week ago

emteknetnz commented 2 weeks ago

Seems like broken job notification emails are not being sent - at least that's the feedback from one developer I've spoken to about this @JoeChamberlain1

When creating a job that throws an exception in its process() method, so that the JobDescriptior->JobStatus is set to Broken, and after removing any non-broken job descriptors from the queue, and then running the queue, an email should be sent to the admin saying that there are broken jobs in the queue

There is an log entry when running the queue "Broken jobs were found in the job queue" - however looking at the code where this comes from https://github.com/symbiote/silverstripe-queuedjobs/blob/4/src/Services/QueuedJobService.php#L500 - I'm not sure where the email is actually being sent

Note that 'NotifiedBroken' is used to limit sending the admin email to a single send

Things might be working fine, though I think we need to validate locally that they actually are

Acceptance criteria

PRs

emteknetnz commented 2 weeks ago

I've validated that an email is NOT sent in a standard environment when there are broken jobs found in the job queue

While the AC's say "create a follow up issue", the fix is pretty simple so I've just gone ahead and implemented it in a linked PR

GuySartorelli commented 1 week ago

PR merged, this will be included in the October minor release.