我有一个通过 envoyer 部署到非伪造服务器的 laravel 5.4 应用程序。我正在数据库驱动程序上运行队列工作器,使用主管进行监视,如文档中所述进行设置;
command=php /home/data/app/current/artisan queue:work --sleep=3 --tries=3
Run Code Online (Sandbox Code Playgroud)
并使用 envoyer 部署挂钩
cd ~/app/current
php artisan queue:restart
Run Code Online (Sandbox Code Playgroud)
问题是,在每次部署后,队列工作人员没有重新启动,旧的工作人员继续运行,然后抛出错误,因为他们正在处理以前版本的代码。运行队列:从 CLI 手动重启也不起作用。
data@medicone:~/ccpbase/current$ ps -aux | grep queue:work
data 4347 0.0 0.2 292988 34852 ? S 11:12 0:00 php /home/data/ccpbase/current/artisan queue:work --sleep=3 --tries=3
data 4348 0.0 0.2 292988 34864 ? S 11:12 0:00 php /home/data/ccpbase/current/artisan queue:work --sleep=3 --tries=3
data 4349 0.0 0.2 292988 34720 ? S 11:12 0:00 php /home/data/ccpbase/current/artisan queue:work --sleep=3 --tries=3
data 4350 0.0 0.2 292988 34880 ? …Run Code Online (Sandbox Code Playgroud)