Azoruk's avatar

Laravel Task Scheduling not running all commands

In my dev environment, I'm using Laravel Homestead. I have a bunch of commands that I ran regularly with Laravel's task scheduler.

Kernel.php:

protected function schedule(Schedule $schedule)
{
    $schedule->command('disposable:update')->weekly();
    $schedule->command('command:randomusercreatesubmission')->withoutOverlapping()->everyTenMinutes();
    $schedule->command('command:randomusercreatecomment')->withoutOverlapping()->everyMinute();
    $schedule->command('command:randomusercreatereply')->withoutOverlapping()->everyMinute();
    $schedule->command('command:randomusersubmissionvote')->withoutOverlapping()->everyMinute();
    $schedule->command('command:randomusercommentvote')->withoutOverlapping()->everyMinute();
    $schedule->command('command:randomusersubscribe')->withoutOverlapping()->everyFiveMinutes();

    $schedule->command(CalculateHotness::class)
        ->runInBackground()
        ->withoutOverlapping()
        ->everyFiveMinutes();

    $schedule->command(CalculateRelativeHotness::class)
        ->runInBackground()
        ->withoutOverlapping()
        ->everyFiveMinutes();

but recently I noticed that some of these scheduled commands aren't running. So I decided to Log whenever a command was run. Turns out, only command:randomusercreatecomment and command:randomusercreatesubmission are being run on schedule. I figured that maybe the next command (command:randomusersubmissionvote) was causing the issue. But when I SSH into homestead and run the command, it runs just fine and logs. I've tried to halt/up vagrant, I rebooted my PC, etc. There's no error log so I don't really understand why all the other commands aren't running.

0 likes
1 reply
Azoruk's avatar

I figured out my problem. All the commands had "withoutOverlapping()". I didn't know that that meant no other commands could run at the same time. So if I have 3 commands that run every 5 minutes, only 1 of them will run with "withoutOverlapping()", I guess? That's kinda dumb.

Please or to participate in this conversation.