无需重启即可清除 Laravel 队列缓存 [英] Clear Laravel Queue Cache without restarting
问题描述
在我的应用程序中,每个客户都有一种复杂的类,我们在其中为该特定客户进行一些搜索和替换.我运行 Queue 工作人员来运行与 eBay 的每日同步,以便每个客户进行某种搜索和替换.
In my application, every customer has a kind of complex class in which we do some search and replaces for that specific customer. I run Queue workers to run a daily sync with eBay for every single customer to do some kind of search and replaces.
问题是 Laravel 队列将代码缓存了很长时间,如果我想更改任何客户类文件(经常发生),我将不得不重新启动队列工作程序(这可能会停止正在运行的作业)我不打算停下来).
The problem is Laravel queues caches the code for a good deal of time and if I want to go and change any customer class file (Which happens frequently), I will have to restart queue workers (Which may stop a running job that I don't intend to stop).
所以我的问题是,如何强制 Laravel Queue 重新读取新代码而不重启工作线程?
So my question is, how to force Laravel Queue to reread the new code without restarting workers?
推荐答案
打开一个额外的终端并使用 artisan 命令
Open an extra terminal and use the artisan command
php artisan queue:restart
这篇关于无需重启即可清除 Laravel 队列缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!