How to keep Laravel Queue system running on server

后端 未结 17 1052
小鲜肉
小鲜肉 2020-11-28 02:23

I recently setup a Laravel Queue system. The basics are a cronjob calls a command which adds jobs to a queue and calls a second command which sends an email.

The sy

17条回答
  •  一个人的身影
    2020-11-28 03:03

    1)sudo apt install supervisor or

    sudo apt-get install supervisor
    

    2)cd /etc/supervisor/conf.d 3)create new file inside

    sudo vim queue-worker.conf
    

    File Content

    [program:email-queue]
    process_name=%(program_name)s_%(process_num)02d
    command=php /var/www/html/laravelproject/artisan queue:work
    autostart=true
    autorestart=true
    user=root
    numprocs=2
    redirect_stderr=true
    stdout_logfile=/var/www/html/laravelproject/storage/logs/supervisord.log
    

    4)sudo supervisorctl reread

    when run this command get output queue-worker:available

    5)sudo supervisorctl update

    when run this command get output queue-worker:added process group

    other command

    1)sudo supervisorctl reload

    when run this command get output Restarted supervisord

    2)sudo service supervisor restart

提交回复
热议问题