Created
October 13, 2015 14:43
-
-
Save JonCrawford/0dfb3c9e3c1c8937a9b3 to your computer and use it in GitHub Desktop.
Clean Stale Resque Workers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Resque.working.select{|w| DateTime.parse(w.job["run_at"]) < 5.hours.ago }.map do |worker| | |
worker.shutdown | |
worker.unregister_worker | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment