Skip to content

Instantly share code, notes, and snippets.

@JonCrawford
Created October 13, 2015 14:43
Show Gist options
  • Save JonCrawford/0dfb3c9e3c1c8937a9b3 to your computer and use it in GitHub Desktop.
Save JonCrawford/0dfb3c9e3c1c8937a9b3 to your computer and use it in GitHub Desktop.
Clean Stale Resque Workers
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