Sha256: c1d34e7ea96433ce400fb497d4e778a66c6db710190391f046492de133d1aff8

Contents?: true

Size: 811 Bytes

Versions: 22

Compression:

Stored size: 811 Bytes

Contents

module CanvasSync::LiveEvents
  class ProcessEventJob < ::CanvasSync::Job
    def perform(event)
      event = event.with_indifferent_access

      # Support Legacy-Style Event Handlers
      begin
        legacy_handler = "LiveEvents::#{event['metadata']['event_name'].camelcase}Event".constantize
        legacy_handler.perform_later(event)
        return
      rescue LoadError, NameError => e
        Rails.logger.error("Error accessing legacy-style LiveEvents handler #{e}, #{event}")
      end

      handlers = CanvasSync::LiveEvents.registered_handlers
      handlers.each do |h|
        h.call(event)
      rescue => e
        throw e if Rails.env.test?
        Rails.logger.error("LiveEvent Handler raised Error: #{e}")
        Raven.captureException(e) if defined? Raven
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
canvas_sync-0.22.9 lib/canvas_sync/live_events/process_event_job.rb
canvas_sync-0.22.8 lib/canvas_sync/live_events/process_event_job.rb
canvas_sync-0.22.6 lib/canvas_sync/live_events/process_event_job.rb
canvas_sync-0.22.5 lib/canvas_sync/live_events/process_event_job.rb
canvas_sync-0.22.4 lib/canvas_sync/live_events/process_event_job.rb
canvas_sync-0.22.3 lib/canvas_sync/live_events/process_event_job.rb
canvas_sync-0.22.2 lib/canvas_sync/live_events/process_event_job.rb
canvas_sync-0.22.1 lib/canvas_sync/live_events/process_event_job.rb
canvas_sync-0.22.0 lib/canvas_sync/live_events/process_event_job.rb
canvas_sync-0.22.0.beta8 lib/canvas_sync/live_events/process_event_job.rb
canvas_sync-0.22.0.beta7 lib/canvas_sync/live_events/process_event_job.rb
canvas_sync-0.22.0.beta6 lib/canvas_sync/live_events/process_event_job.rb
canvas_sync-0.22.0.beta5 lib/canvas_sync/live_events/process_event_job.rb
canvas_sync-0.22.0.beta4 lib/canvas_sync/live_events/process_event_job.rb
canvas_sync-0.22.0.beta3 lib/canvas_sync/live_events/process_event_job.rb
canvas_sync-0.22.0.beta2 lib/canvas_sync/live_events/process_event_job.rb
canvas_sync-0.22.0.beta1 lib/canvas_sync/live_events/process_event_job.rb
canvas_sync-0.21.1 lib/canvas_sync/live_events/process_event_job.rb
canvas_sync-0.21.1.beta1 lib/canvas_sync/live_events/process_event_job.rb
canvas_sync-0.21.0 lib/canvas_sync/live_events/process_event_job.rb