Laravel Forge Does Not Run Scheduled Command

50 views Asked by At

Something is wrong with command running on Laravel Forge via their scheduler. I have plenty of commands there already and all of hthem are running just fine. Scheduler setup is generic, it calls artisan schedule:run every minute and everything is fine with existing commands.

However, I added a new one and registered it in the scheduler (in the Console/Kernel)

$schedule->command('new-command-signature')
            ->daily()
            ->between('22:00', '23:00');

Also registered the command class name in the Kernel $commands property.

And - nothing. It is not picked up and not triggered.

I have another command registered besides the new one with very similar config

$schedule->command('another-command')
            ->daily()
            ->between('23:00', '1:00');

And it keeps working like a charm.

I didn't have such issues before, commands were picked up just fine. Are there any ways to address this issue?

What I tried already:

  1. restarting the scheduler
  2. clearing the app cache and the scheduler cache
1

There are 1 answers

0
Gino Pane On

Probably there's a bug with between('XX:YY', 'ZZ:WW'); definition when multiple schedules are defined. My config had this for 2 commands, and though schedules were not clashing, the command registered earlier was ignored.

So I managed to fix this by removing between on my command which wasn't running. Now it is working fine.