使用 Resque 重新排队作业
我对使用 Resque 将工作分发到许多不同的计算机感兴趣。不过我有一个担忧。如果我需要杀死正在执行某项工作的一名工作人员,我希望能够让它自动重新排队该工作,以确保它由另一名工作人员运行。我使用过 Django Celery,只需执行 CTRL+C 即可杀死工作人员并重新排队任务。 Rails 中的 Resque 有办法实现这种情况吗?谢谢你!
I am interested in using Resque to distribute work to many different computers. I have one concern though. If I need to kill one of the workers that is working on a job, I would like to be able to have it automatically requeue that job to ensure that it gets run by another worker. I've worked with Django Celery and just do CTRL+C which kills the worker as well as requeues the task. Is there a way for this to happen with Resque in Rails? Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我刚刚想通了。我可以捕获信号项 (CTRL-C) 并强制它重新排队作业或告诉作业失败并稍后通过 resque-retry 重新排队作业。
例如:
抱歉这个愚蠢的问题;)
I just figured it out. I can trap the signal term (CTRL-C) and force it to either requeue the job or tell the job to fail and have resque-retry requeue the job at a later time.
For example:
Sorry for the silly question ;)