Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

SanikVarik's avatar

Schedule not stoping.

Laravel 11 Run in Docker

Hello everyone! I encountered an issue with hanging processes. Specifically, /usr/local/bin/php artisan schedule:run appears in my process log about 10 times

I have 5 cron jobs, each limited to a maximum execution time of one hour, but how can they exist for more than 4 hours?

Here is an example of a cron job (the others have different start times):

in console.php

Schedule::call(function () {
    ini_set('max_execution_time', 3600);
    try {
        \App\Http\Controllers\Cron\Some::Update();
    } catch (\Exception $exception) {
        $tg = new Telegram();
        $errorMessage = "CRON Products " . $exception->getMessage() . "\n";
        $errorMessage .= "In file: " . $exception->getFile() . "\n";
        $errorMessage .= "On line: " . $exception->getLine() . "\n";
        $errorMessage .= "Stack trace:\n" . $exception->getTraceAsString();
        $tg->msgSend($errorMessage);
    }
})->hourlyAt(10);

What did I do wrong? Or where should I look for my problem?

0 likes
2 replies
SanikVarik's avatar

@Nakov Thank you) Yes, that could work, but some tasks might be missed. I found my mistakes, including realizing that I can't rely on "max_execution_time". I've already decided to rewrite it using queues and just add tasks via cron, which will probably be more correct =)

Please or to participate in this conversation.