Sha256: 0aecf1dcdb980b51a5c9846213e1b5841cea8f8ffe517327be84858b55c4ef15
Contents?: true
Size: 1.07 KB
Versions: 30
Compression:
Stored size: 1.07 KB
Contents
require 'shoryuken' module Rollbar module Delay # Following class allows to send rollbars using Sho-ryu-ken as a background jobs processor. # see the queue_name method which states that your queues needs to be names as "rollbar_ENVIRONMENT". # retry intervals will be used to retry sending the same message again if failed before. class Shoryuken include ::Shoryuken::Worker class << self attr_accessor :queue end self.queue = "rollbar_#{Rollbar.configuration.environment}" def self.call(payload) new.call(payload, :queue => queue) end def call(payload, options = {}) self.class.perform_async(payload, options) end # not allowing bulk, to not double-report rollbars if one of them failed in bunch. shoryuken_options :auto_delete => true, :body_parser => :json, :retry_intervals => [60, 180, 360, 120_0, 360_0, 186_00] def perform(_sqs_message, payload) Rollbar.process_from_async_handler(payload) end end end end
Version data entries
30 entries across 30 versions & 1 rubygems