Sha256: 6f509c87f8854c2150d3c60829c29dbb75689a235d84d5a0142f5f56bdab8029

Contents?: true

Size: 652 Bytes

Versions: 4

Compression:

Stored size: 652 Bytes

Contents

module Apress
  module Api
    class FireCallbackJob
      include Resque::Integration
      extend Resque::Plugins::ExponentialBackoff

      queue :api_callbacks

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

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

        callback_class.call!(
          event: event,
          params: params
        )
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
apress-api-1.24.0 app/jobs/apress/api/fire_callback_job.rb
apress-api-1.23.0 app/jobs/apress/api/fire_callback_job.rb
apress-api-1.22.1 app/jobs/apress/api/fire_callback_job.rb
apress-api-1.22.0 app/jobs/apress/api/fire_callback_job.rb