Sha256: 941fb0d2de28cb6431d36e41de18cd41c14e737e3686dec68578f3937b825dd8

Contents?: true

Size: 741 Bytes

Versions: 16

Compression:

Stored size: 741 Bytes

Contents

require 'active_job/arguments'

module ActiveJob
  module Arguments
    extend self

    def deserialize_global_id(hash)
      gid = GlobalID.parse(hash[GLOBALID_KEY])
      # For non database based processors like sidekiq, the reactor may trigger before the
      # transaction is committed. Attempt to wait for the transaction to be commited before
      # running the reactor. This is not a perfect solution, but it's better than nothing.
      if Eventsimple.configuration.retry_reactor_on_record_not_found
        Retriable.with_context(:reactor) do
          gid.model_class.uncached { GlobalID::Locator.locate hash[GLOBALID_KEY] }
        end
      else
        GlobalID::Locator.locate hash[GLOBALID_KEY]
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
eventsimple-1.5.6 lib/eventsimple/active_job/arguments.rb
eventsimple-1.5.5 lib/eventsimple/active_job/arguments.rb
eventsimple-1.5.4 lib/eventsimple/active_job/arguments.rb
eventsimple-1.5.3 lib/eventsimple/active_job/arguments.rb
eventsimple-1.4.3 lib/eventsimple/active_job/arguments.rb
eventsimple-1.4.2 lib/eventsimple/active_job/arguments.rb
eventsimple-1.4.1 lib/eventsimple/active_job/arguments.rb
eventsimple-1.4.0 lib/eventsimple/active_job/arguments.rb
eventsimple-1.3.3 lib/eventsimple/active_job/arguments.rb
eventsimple-1.3.2 lib/eventsimple/active_job/arguments.rb
eventsimple-1.3.1 lib/eventsimple/active_job/arguments.rb
eventsimple-1.3.0 lib/eventsimple/active_job/arguments.rb
eventsimple-1.2.3 lib/eventsimple/active_job/arguments.rb
eventsimple-1.2.2 lib/eventsimple/active_job/arguments.rb
eventsimple-1.2.1 lib/eventsimple/active_job/arguments.rb
eventsimple-1.2.0 lib/eventsimple/active_job/arguments.rb