How do I clear stuck/stale Resque workers?

后端 未结 15 796
你的背包
你的背包 2020-12-07 07:22

As you can see from the attached image, I\'ve got a couple of workers that seem to be stuck. Those processes shouldn\'t take longer than a couple of seconds.

15条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-07 07:47

    Here's how you can purge them from Redis by hostname. This happens to me when I decommission a server and workers do not exit gracefully.

    Resque.workers.each { |w| w.unregister_worker if w.id.start_with?(hostname) }
    

提交回复
热议问题