Skip to content

Instantly share code, notes, and snippets.

@joncode
Last active August 29, 2015 14:05
Show Gist options
  • Select an option

  • Save joncode/ba9325652ab51bf32c70 to your computer and use it in GitHub Desktop.

Select an option

Save joncode/ba9325652ab51bf32c70 to your computer and use it in GitHub Desktop.
Resque commands
http://www.rubydoc.info/gems/resque/frames
Resque.info
{:pending=>0, :processed=>157473, :queues=>7, :workers=>21, :working=>0, :failed=>0, :servers=>["redis://barb.redistogo.com:9497/0"], :environment=>"production"}
Resque.workers
returns an array of workers available
Resque.workers.each {|w| w.prune_dead_workers }
kills dead workers
w = Resque.workers[0]
w.state
=> working
w.processing #=> get the time it ran at and the params
=> {"queue"=>"gifting", "run_at"=>"2014-08-13T05:10:20Z", "payload"=>{"class"=>"ProtoGifterJob", "args"=>[118]}}
w.unregister_worker #=> if all else fails , this will run the callback :on_failure_*
returns an array
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment