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.…