Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Add an abort callback to allow other modules to process an item that have failed after reaching the maximum retry attempts.
Comment | File | Size | Author |
---|---|---|---|
#2 | advancedqueue-abort-callback-2623884-1.patch | 836 bytes | msgph |
|
Comments
Comment #2
msgph CreditAttribution: msgph as a volunteer and at Wunder commentedComment #3
msgph CreditAttribution: msgph as a volunteer and at Wunder commentedComment #4
msgph CreditAttribution: msgph as a volunteer and at Wunder commentedComment #5
Kazanir CreditAttribution: Kazanir at Platform.sh commentedThis 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.