Tuesday 15 July 2014

ruby on rails - sidekiq retries exhausted with arguments -



ruby on rails - sidekiq retries exhausted with arguments -

i crawl leads other sites , activate them @ mine. sidekiq run healthcheckerworker every hr deactivate lead on site unless it's still , running on other site.

sometimes healthcheckerworker throws error, ie: bad uri etc... dilemma here if job fails 10 times, in dead job queue, lead still considered active although may long gone on other site.

i thought solution add together sidekiq_retries_exhausted block so:

sidekiq_retries_exhausted |lead_id| lead.find(lead_id).deactivate end

but defined in docs:

the hook receives queued message argument. hook called right before sidekiq moves job djq.

so gets message argument. how can deactivate lead after retries exhausted?

the message entire job, including arguments. pull out arguments.

sidekiq_retries_exhausted |msg| lead_id = msg['args'].first lead.find(lead_id).deactivate end

ruby-on-rails ruby sidekiq

No comments:

Post a Comment