Menu

Slow Job Alerts in Laravel 13.40: What whenJobRunsLongerThan Catches and What It Misses
📰

Slow Job Alerts in Laravel 13.40: What whenJobRunsLongerThan Catches and What It Misses

DEV Community: laravel·Hafiz·about 4 hours ago
#t5jlqnle
#devtolaravel#devto#dev#jobs#queue
Reading 0:00
15s threshold

Originally published at hafiz.dev

Laravel 13.40 shipped on 3 November with Queue::whenJobRunsLongerThan() , a one-liner that tells you when a queued job runs slower than it should. The scheduler got a twin, Schedule::whenTaskRunsLongerThan() , in the same release . The queue docs don't cover either one yet, so I tested them.

On a fresh Laravel 13.40.0 install with the database queue driver and PHP 8.3, I pushed five jobs through one worker: a fast one, a slow one, one that fails, one that releases itself, and one that runs past the worker's --timeout . Four did what you'd expect. The fifth is the one to know about before you build alerting on this. All output below is real.

What 13.40 added

PR #62141 adds the queue version.…

Continue reading — create a free account

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