Queues are used to defer the processing of a time consuming tasks, such as sending emails, until a later time. Deferring these time consuming tasks drastically speeds up the requests, making the user experience better.
The queues system is powered by Laravel Queues.
For this guide, we assume that the help desk is installed at
In order for the queued tasks to be executed, the
php artisan queue:work command should be executed at the root directory of the installation. Note that once the
queue:work command has started, it will continue to run until it is manually stopped or you close your terminal.
To keep the
queue:work process running permanently in the background, we will use the process monitor, Supervisor, to ensure that the queue worker does not stop running.
Supervisor is a process monitor for the Linux operating system, and will automatically restart your
queue:work process if it fails. To install Supervisor on Ubuntu, you may use the following command:
sudo apt-get install supervisor
Supervisor configuration files are typically stored in the
/etc/supervisor/conf.d directory. Within this directory, you may create any number of configuration files that instruct supervisor how your processes should be monitored. For example, let's create a
fullhelp.conf file that starts and monitors a
command=/usr/bin/php /var/www/fullhelp/live/artisan queue:work --sleep=3 --tries=3
Make sure to replace
/var/www/fullhelp/live with the path to your own installation. Feel free to adjust any of the values as you need.
Once the configuration file has been created (or updated), start the processes using the following commands:
sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl start fullhelp-queue:*
Feel free to contact us if you cannot find what you are looking for in our help center. We will be answering you shortly!
Feel free to contact us if you cannot find what you are looking for in our help center. We will be answering you shortly!Contact us