1

I have a question about Laravel queue. first of all My queue driver is database, if I once call the cron job with command queue:work, the queue will work forever? or i must define a cron job run every minutes?

Morteza Negahi
  • 3,305
  • 8
  • 24
  • 42

1 Answers1

1

you need to set your command or queue for every minute in Console/Kernel.php file's Schedule function

Command:

$schedule->command('your-command')->everyMinute();

Job:

$schedule->job(new JOBCLASS)->everyMinute();

then you need to enter

* * * * * php /path-to-your-project/artisan schedule:run >> /dev/null 2>&1

in your crontab file on server which check every minute in your kernel file to check whether any command is set or not

ankit patel
  • 1,888
  • 11
  • 12