Sha256: 0a3ce527d4a52182b8cf69052f5e334aa49a9d3fcc58823b2ec06776284576f3

Contents?: true

Size: 711 Bytes

Versions: 41

Compression:

Stored size: 711 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_id = args[0]
      entities_hash = args[1]

      [organization_id, entities_hash.keys.sort]
    end

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

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
maestrano-connector-rails-2.0.0.pre.RC11 app/jobs/maestrano/connector/rails/push_to_connec_worker.rb
maestrano-connector-rails-2.0.0.pre.RC10 app/jobs/maestrano/connector/rails/push_to_connec_worker.rb
maestrano-connector-rails-2.0.0.pre.RC9 app/jobs/maestrano/connector/rails/push_to_connec_worker.rb
maestrano-connector-rails-2.0.0.pre.RC8 app/jobs/maestrano/connector/rails/push_to_connec_worker.rb
maestrano-connector-rails-1.5.0 app/jobs/maestrano/connector/rails/push_to_connec_worker.rb
maestrano-connector-rails-2.0.0.pre.RC7 app/jobs/maestrano/connector/rails/push_to_connec_worker.rb
maestrano-connector-rails-2.0.0.pre.RC6 app/jobs/maestrano/connector/rails/push_to_connec_worker.rb
maestrano-connector-rails-2.0.0.pre.RC5 app/jobs/maestrano/connector/rails/push_to_connec_worker.rb
maestrano-connector-rails-2.0.0.pre.RC4 app/jobs/maestrano/connector/rails/push_to_connec_worker.rb
maestrano-connector-rails-2.0.0.pre.RC3 app/jobs/maestrano/connector/rails/push_to_connec_worker.rb
maestrano-connector-rails-2.0.0.pre.RC2 app/jobs/maestrano/connector/rails/push_to_connec_worker.rb
maestrano-connector-rails-2.0.0.pre.RC1 app/jobs/maestrano/connector/rails/push_to_connec_worker.rb
maestrano-connector-rails-1.4.0 app/jobs/maestrano/connector/rails/push_to_connec_worker.rb
maestrano-connector-rails-1.3.5 app/jobs/maestrano/connector/rails/push_to_connec_worker.rb
maestrano-connector-rails-1.3.4 app/jobs/maestrano/connector/rails/push_to_connec_worker.rb
maestrano-connector-rails-1.3.3 app/jobs/maestrano/connector/rails/push_to_connec_worker.rb
maestrano-connector-rails-1.3.2 app/jobs/maestrano/connector/rails/push_to_connec_worker.rb
maestrano-connector-rails-1.3.1 app/jobs/maestrano/connector/rails/push_to_connec_worker.rb
maestrano-connector-rails-1.3.0 app/jobs/maestrano/connector/rails/push_to_connec_worker.rb
maestrano-connector-rails-1.2.3 app/jobs/maestrano/connector/rails/push_to_connec_worker.rb