I am using a laravel queue job to send emails with an excel attachment. And many a time it is happening, that whenever I update any code change, it doesn't consider the updated code, rather it runs the old code. How can I prevent this?
Show activity on this post. This is lower level but in the same vein you could run a command such as ps -aux | grep queue to literally view the running queue processes on whatever server your application/queue workers are running on.
Sync, or synchronous, is the default queue driver which runs a queued job within your existing process. With this driver enabled, you effectively have no queue as the queued job runs immediately.
Laravel Jobs are not asynchronous.
Jobs and Queues The line itself is the Queue, and each customer in the line is a Job. In order to process Jobs in the Queue you need command line processes or daemons. Think of launching a queue daemon on the command line as adding a new bank teller to the pool of available bank tellers.
Each time you deploy your Laravel app, or make any code change, you should run:
php artisan queue:restart
Of course make sure that in Supervisor you have set autostart
to true.
You can read on https://laravel.com/docs/5.4/queues#running-the-queue-worker :
Since queue workers are long-lived processes, they will not pick up changes to your code without being restarted. So, the simplest way to deploy an application using queue workers is to restart the workers during your deployment process. You may gracefully restart all of the workers by issuing the queue:restart
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With