Queue backend has onFailure function
But Job type don's have onFailure function to handle some addtional logic when fail eventually after max tries.

CommentFileSizeAuthor
#4 3537279-8x-1-4.patch1.95 KBlawxen
Command icon 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

lawxen created an issue. See original summary.

lawxen’s picture

Status: Active » Needs review
lawxen’s picture

StatusFileSize
new1.95 KB

Backup a patch for 8.x-1.4

alexpott’s picture

Status: Needs review » Postponed (maintainer needs more info)

I'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.

lawxen’s picture

Besides 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.