Skip to content

Commit

Permalink
fix(callbacks): add exponential backoff
Browse files Browse the repository at this point in the history
  • Loading branch information
deniskorobicyn committed Apr 12, 2018
1 parent 26457ee commit ca1c1f2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/jobs/apress/api/fire_callback_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ module Apress
module Api
class FireCallbackJob
include Resque::Integration
extend Resque::Plugins::ExponentialBackoff

queue :api_callbacks
retrys delay: 10, limit: 2
@retry_exceptions = [Apress::Api::Callbacks::FireCallbackError]

@retry_exceptions = {Apress::Api::Callbacks::FireCallbackError => [1, 60, 300, 3600]}

def self.perform(service, event, params)
callback_class = "#{service}_client/fire_callback".camelize.constantize
Expand Down

0 comments on commit ca1c1f2

Please sign in to comment.