The queue worker handles heavy tasks in the background to ensure your clients don't face slow loading pages or interruptions. This includes tasks such as sending webhooks, processing data and sending emails.
If your panel is displaying an erorr that the Queue Worker is not running after clearing cache or updating, please wait for 5 minutes. If the error doesn't go away try one of the non-default queue services.
WemX by default has a queue worker that is started using Laravels Schedule system. This requires the cronjobs to be running.
Edit file /var/www/wemx/.env, update or add CRON_QUEUE and set it to true
CRON_QUEUE=true
If CRON_QUEUE doesn't exists in your env file that means its already being used as default. You can still add it and set it to true
You can also use Ubuntu's systemctl to run a service for the queue system. This option is more reliable but needs some additional setup. You may use this if the cron queue isn't working as intended.
Edit file /var/www/wemx/.env, update or add CRON_QUEUE and set it to false
CRON_QUEUE=false
Let's create the new queue worker.
nano /etc/systemd/system/wemx.service
Paste in the following: (Important: Replace /var/www/wemx/ with your wemx installation path if its different from default)
# WemX Queue Worker File
# ----------------------------------
[Unit]
Description=WemX Queue Worker
[Service]
# On some systems the user and group might be different.
# Some systems use `apache` or `nginx` as the user and group.
User=root
Group=www-data
Restart=always
ExecStart=/usr/bin/php /var/www/wemx/artisan queue:work --sleep=3 --tries=3 --stop-when-empty
StartLimitInterval=180
StartLimitBurst=30
RestartSec=5s
[Install]
WantedBy=multi-user.target
Enable the service
sudo systemctl enable --now wemx.service
Finally, check the status of the queue worker using, check the response and make sure its running as expected.
systemctl status wemx.service
WemX is built using Laravel meaning you can use a lot of other queue workers supported by Laravel. You can read more about the supported queue drivers here https://laravel.com/docs/10.x/queues