Menu

Laravel queues in production: 9 settings that stop jobs from failing silently (or running twice)
📰

Laravel queues in production: 9 settings that stop jobs from failing silently (or running twice)

DEV Community: php·Sanad Kit·1 day ago
#XPVYlRvK
#devto#dev#queue#exit#timeout
Reading 0:00
15s threshold

Queues are the part of a Laravel app that breaks without telling you. A request that throws a 500 shows up in your error tracker within seconds. A job that times out, gets retried after its worker was killed, or runs before its database row exists can just... not do its work. Days later, a customer asks why their invoice email never came.

Below are nine settings I check on every production Laravel app that uses queues. Everything here is verified against the official Laravel queue docs (12.x and 13.x) and the default config/queue.php in the Laravel skeleton. Nothing needs a package beyond the framework.

Laravel 13 note: the 13.x docs now show PHP attributes for job settings: #[Tries(10)] , #[Timeout(120)] , #[Backoff([1, 5, 10])] , #[FailOnTimeout] , #[DeleteWhenMissingModels] (from Illuminate\Queue\Attributes ). The public properties used below still work. In 13.x the framework reads the attribute first and falls back to the property.

1.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.