Add an abort callback to allow other modules to process an item that have failed after reaching the maximum retry attempts.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

msgph created an issue. See original summary.

msgph’s picture

FileSize
836 bytes
msgph’s picture

Assigned: msgph » Unassigned
msgph’s picture

Status: Active » Needs review
Kazanir’s picture

Status: Needs review » Closed (won't fix)

This really seems like something that should be handled by the main worker callback. (The number of attempts is available on the $item->data provided to the worker, and the queue name is available there as $item->name property if you want to check max attempts.) Allowing an additional function seems like a small slice of the larger use case handled by hook_advanced_queue_info_alter(), which allows you to replace the worker callback outright if that's what you prefer. Keeping things to a single function seems best here.