By LaravelShart
Ok, I’ve been back and forth with support now 8 times and they don’t understand / see the issue.
1 and 2 have the same codebase and the same environment variables. The worker component has the following run command(s). It will start the worker process and will schedule the scheduler.
nohup php artisan queue:work --daemon &
while true; do
echo "=> Running scheduler"
php artisan schedule:run || true;
echo "=> Sleeping for 60 seconds"
sleep 60;
done
In the web service we have created a page to see the queue size. And we are sure that there are items in the queue.
When the worker is started, the jobs are not processed. When I go in the console of the worker and start the process manually, the process starts, but doesn’t process any of the jobs.
When I go into the web service and start the queue:work, it processes the jobs in the queue.
Same code base, (as this is grabbed from GitHub), same env variables. No errors, no logs nothing. The Redis connection seems to be fine.
And yes, the ENV var QUEUE_CONNECTION is set to redis on both applications.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
You may want to try making a bash script with the commands to run, and using that as the run command.
Something like this:
#!/bin/bash
php artisan queue:work --daemon &
while true; do
echo "=> Running scheduler"
php artisan schedule:run || true;
echo "=> Sleeping for 60 seconds"
sleep 60;
done
And set the run command of the worker to worker.sh
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.