Skip to content

Instantly share code, notes, and snippets.

@bsy
Created December 8, 2014 21:57
Show Gist options
  • Save bsy/1ab2a23d0c42329dbaa8 to your computer and use it in GitHub Desktop.
Save bsy/1ab2a23d0c42329dbaa8 to your computer and use it in GitHub Desktop.
Clear out stale resque workers
Resque.workers.each {|w| matches = w.id.match(/^[^:]*:([0-9]*):[^:]*$/); pid = matches[1]; w.unregister_worker unless w.worker_pids.include?(pid.to_s)}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment