Skip to content

Instantly share code, notes, and snippets.

@brunopedroso
Created January 29, 2018 19:55
Show Gist options
  • Save brunopedroso/a7fc4f269f2bd65afd149f146aa22f52 to your computer and use it in GitHub Desktop.
Save brunopedroso/a7fc4f269f2bd65afd149f146aa22f52 to your computer and use it in GitHub Desktop.
==== limpar resque
Resque::Failure.count
a = Resque::Failure.all(0,50); nil
lista = []
a.each_with_index do |x,i|
if x['payload']['args'].first['queue_name'] == 'salary_stub_load_job'
lista << i
end
end
lista.sort.revert.each {|i| Resque::Failure.remove(i)}
# pegar a lista de argumetnos dos falhos:
a.map {|el| el['payload']['args'].first['arguments'].first.slice("cpf", "deal_id", "person_id")}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment