Sha256: 8ffbacef1ce1772dbe1bd0edfbc0a7d597fa2f3d1bd3752821bdb3f040c13c95

Contents?: true

Size: 651 Bytes

Versions: 1

Compression:

Stored size: 651 Bytes

Contents

module Maestrano::Connector::Rails

  # This class process the push to Connec, it use PushToConnecJob for retrocompatibility
  # By using sidekiq-unique-jobs, it makes sure that 2 calls on the same entity, are processed in order
  class PushToConnecWorker
    include Sidekiq::Worker
    sidekiq_options unique: :while_executing, unique_args: :unique_args

    def self.unique_args(args)
      organization = args[0]
      entities_hash = args[1]
      return[organization.id, entities_hash.keys.sort]
    end

    def perform(organization, entities_hash, opts={})
      PushToConnecJob.new.perform(organization, entities_hash, opts)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
maestrano-connector-rails-1.2.1 app/jobs/maestrano/connector/rails/push_to_connec_worker.rb