supervisor and schedule:run

Posted 11 months ago by deansatch

I have a few tasks that need to be constantly checked e.g. has account expired, is invoice due etc... and each task does something like 'find accounts that have past expiry date, loop through and send email to each user'

I have set these up in console/Kernel.php as:


$schedule->call('App\[email protected]')->everyMinute();
$schedule->call('App\[email protected]')->everyMinute();

If I run the command artisan schedule:run in terminal it works as expected. If I wait for another account to expire, type it again it runs.

Likewise if I set the command in supervisor I see it run and work as expected but then it exits and never runs again. I get an "Exited too quickly" error...sometimes it says FATAL, sometimes BACKOFF.

Supervisor conf file command:


command=php /var/www/mysite/artisan schedule:run


a) should I be using a different method? I see there are queues :work, :listen etc... but not really sure what the differences are between all these.

b) if I'm using correct method, how do I get it to run my schedules every minute?

Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up

Channels

Reply to

Use Markdown with GitHub-flavored code blocks.