Let the platform do the work

Job Queue Hooks

Job Queue hooks execute logic when working with the Job Queue module.

Topics

The job_failure hook executes when a job's final failure occurs.
The job_failure_retry hook executes each time a job fails before its final failure. If you only want action on the final failure, use the job_failure logic hook.