Redis 和 Resque,工作人员未获取更新的应用程序代码

发布于 2024-11-24 14:41:44 字数 373 浏览 1 评论 0原文

我在 Resque 上遇到了困难,首先,在开发过程中,运行 rake resque:work QUEUE='*' 来处理队列时,它启动正常并开始运行 perform 为我的工人提供的方法,这很好;问题是工作人员似乎没有运行我的新应用程序代码,假设我更新该工作人员中的 perform 方法,然后 Ctrl+c 退出该 rake resque:work QUEUE='*' 进程并再次启动它,同时对要处理的新作业进行排队不会导致工作线程使用新的更新代码运行。

所以我的主要问题是,如何安全地终止 resque:work 任务并使用新的应用程序代码重新启动我的工作人员?

I'm having a rough time here with Resque, firstly, in development when running rake resque:work QUEUE='*' to work on the queue it starts up fine and starts running the perform method for my workers, which is fine; the problem is that the workers don't seem to run my new application code, say I update the perform method in that worker then Ctrl+c out of that rake resque:work QUEUE='*' process and starting it up again, whilst queuing new jobs to be worked on doesn't result in the worker running with the new updated code.

So mainly my problem here is, how do I safely kill the resque:work task and restart my workers with the new application code?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

与之呼应 2024-12-01 14:41:44

Resque 工作线程响应一些不同的信号:

QUIT - Wait for child to finish processing then exit
TERM / INT - Immediately kill child then exit
USR1 - Immediately kill child but don't exit
USR2 - Don't start to process any new jobs
CONT - Start to process new jobs again after a USR2

如果您想正常关闭 Resque 工作线程,请使用 QUIT。

kill -s QUIT reqsue.pid

如果你想使用 capitrano 设置 resque restart,请使用 this gits

Resque workers respond to a few different signals:

QUIT - Wait for child to finish processing then exit
TERM / INT - Immediately kill child then exit
USR1 - Immediately kill child but don't exit
USR2 - Don't start to process any new jobs
CONT - Start to process new jobs again after a USR2

If you want to gracefully shutdown a Resque worker, use QUIT.

kill -s QUIT reqsue.pid

if you want to setup resque restart with capitrano, use this gits

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文