Skip to content

Instantly share code, notes, and snippets.

@r3ap3r2004
Forked from kbaum/gist:892247
Created March 19, 2012 11:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save r3ap3r2004/2108314 to your computer and use it in GitHub Desktop.
Save r3ap3r2004/2108314 to your computer and use it in GitHub Desktop.
prune_workers_from_terminated_instance.rb
module Resque
def self.unregister_workers_for_host(host)
Resque.workers.select{|worker| worker.id.split(':').first==host}.each(&:unregister_worker)
end
end
Resque.unregister_workers_for_host("ip-10-250-192-51")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment