Running laravel queue:work on a shared hosting

后端 未结 6 1934
你的背包
你的背包 2020-12-18 01:45

I want my laravel queue:work to keep running on a shared hosting, this is a shared hosting (am not on a VPS) I can\'t install anything because almost all on

6条回答
  •  没有蜡笔的小新
    2020-12-18 02:14

    One more solution (I solved same problem in this way). You can make script like this:

    # getting running processes with name "queue:work"
    QUEUE_STATUS=$(ps aux | grep "queue:work")
    
    # check is queue:work started, if no, start it
    if $( echo $QUEUE_STATUS | grep --quiet 'artisan queue:work')
    then
        exit;
    else
        php ~/public_html/artisan queue:work
    fi
    

    and run it in CRON. I run every 10 min.

提交回复
热议问题