Queue backend has onFailure function
But Job type don's have onFailure function to handle some addtional logic when fail eventually after max tries.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 3537279-8x-1-4.patch | 1.95 KB | lawxen |
Issue fork advancedqueue-3537279
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
lawxen commentedComment #4
lawxen commentedBackup a patch for 8.x-1.4
Comment #5
alexpottI'm not sure this is necessary - if you really want to do that you could use the post process event and check the job state there. We don't have an onSuccess either.
I think we need more justification with a real example use-case that couldn't be solved with an event listener.
Comment #6
lawxen commentedBesides post process event, We can also check the job state on each job's process() function
We must recalculate if it's the real end failure. There won't be any problem with the regular count calculation. But on exception/failure the recalculation may cause some bugs in an extremely complex queue system if the code is not rigorous.
So we want to add an onFailure() function to avoid such risks and complexities.