Skip to content

Instantly share code, notes, and snippets.

@nurey
Forked from kbaum/gist:892247
Created July 17, 2012 15:40
Show Gist options
  • Save nurey/3130172 to your computer and use it in GitHub Desktop.
Save nurey/3130172 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