- Issue created by @jonathanshaw
The JobTypeInterface has a handleDuplicateJobs() method which can return null. But the Queue entity is not equipped to handle nulls returned by that method.
/**
* Handles existing jobs detected as duplicates when enqueuing a new job.
*
* A function can be used to execute a range of different strategies with
* regard to duplicate jobs:
* - to pass the decision up to the job creator, throw DuplicateJobException;
* - to enqueue the new job anyway, return the job;
* - to overwrite the duplicate job, if the backend implements
* SupportsDeletingJobsInterface delete the duplicate job on the backend
* and return the new job;
* - to merge the payloads, delete the duplicate job and return the new job
* with a modified payload;
* - to discard the new job and leave the duplicate intact, return NULL.
...
* @return \Drupal\advancedqueue\JobResult|null
* A new job to enqueue on the backend, or null if no new job should
* be enqueued.
...
*/
public function handleDuplicateJobs(Job $job, array $duplicates, BackendInterface $backend): ?Job;
Harden the queue entity to allow for the possibility that the job plugin wishes to cancel the new job because it's a duplicate.
None.
None.
None.
Active
1.0
Code