Laravel 队列作业没有更新到最新代码

Laravel queue job doesn't updates to the latest code

我正在使用 laravel 队列作业发送带有 excel 附件的电子邮件。很多时候,每当我更新任何代码更改时,它都不会考虑更新的代码,而是运行旧代码。我该如何防止这种情况?

每次部署 Laravel 应用程序或进行任何代码更改时,您应该 运行:

php artisan queue:restart

当然要确保在 Supervisor 中您已将 autostart 设置为 true。

您可以继续阅读 https://laravel.com/docs/5.4/queues#running-the-queue-worker :

Since queue workers are long-lived processes, they will not pick up changes to your code without being restarted. So, the simplest way to deploy an application using queue workers is to restart the workers during your deployment process. You may gracefully restart all of the workers by issuing the queue:restart