UrlDiscoveredListener: add tries and failed() handler #20
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
App\Listeners\UrlDiscoveredListenerimplementsShouldQueuebut has no$triesorfailed()method. Default Laravel behavior on the production queue is effectively unlimited retries on transient failures.Combined with the absence of unique-violation handling in
firstOrCreateunder concurrent listener execution (two workers racing on the same URL), a transient PG hiccup can trigger a retry storm with no audit trail.Goal
Bound the retry count and add observability for permanent failures.
Acceptance criteria
public int $tries = 3;(or similar) on the listener.public function failed(UrlDiscovered $event, Throwable $e): voidthat logs the event payload identity (instance_id, url, postUrl) plus the exception class and message at warning level.failed()is invoked with the right shape. UseBus::fake()or queue-driver inspection.Out of scope