Sha256: c3b5873bfe6690752d707c0fe7f24c66c3b1634141ba8081ad085b9894d51c01

Contents?: true

Size: 804 Bytes

Versions: 24

Compression:

Stored size: 804 Bytes

Contents

# frozen_string_literal: true

module SidekiqUniqueJobs
  class Lock
    #
    # Validates the sidekiq options for the Sidekiq client process
    #
    # @author Mikael Henriksson <mikael@zoolutions.se>
    #
    class ClientValidator
      #
      # @return [Array<Symbol>] a collection of invalid conflict resolutions
      INVALID_ON_CONFLICTS = [:raise, :reject, :reschedule].freeze

      #
      # Validates the sidekiq options for the Sidekiq client process
      #
      #
      def self.validate(lock_config)
        on_conflict = lock_config.on_client_conflict
        return lock_config unless INVALID_ON_CONFLICTS.include?(on_conflict)

        lock_config.errors[:on_client_conflict] = "#{on_conflict} is incompatible with the client process"
        lock_config
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
sidekiq-unique-jobs-7.0.0.beta25 lib/sidekiq_unique_jobs/lock/client_validator.rb
sidekiq-unique-jobs-7.0.0.beta24 lib/sidekiq_unique_jobs/lock/client_validator.rb
sidekiq-unique-jobs-7.0.0.beta23 lib/sidekiq_unique_jobs/lock/client_validator.rb
sidekiq-unique-jobs-7.0.0.beta22 lib/sidekiq_unique_jobs/lock/client_validator.rb
sidekiq-unique-jobs-7.0.0.beta21 lib/sidekiq_unique_jobs/lock/client_validator.rb
sidekiq-unique-jobs-7.0.0.beta20 lib/sidekiq_unique_jobs/lock/client_validator.rb
sidekiq-unique-jobs-7.0.0.beta19 lib/sidekiq_unique_jobs/lock/client_validator.rb
sidekiq-unique-jobs-7.0.0.beta18 lib/sidekiq_unique_jobs/lock/client_validator.rb
sidekiq-unique-jobs-7.0.0.beta17 lib/sidekiq_unique_jobs/lock/client_validator.rb
sidekiq-unique-jobs-7.0.0.beta16 lib/sidekiq_unique_jobs/lock/client_validator.rb
sidekiq-unique-jobs-7.0.0.beta15 lib/sidekiq_unique_jobs/lock/client_validator.rb
sidekiq-unique-jobs-7.0.0.beta14 lib/sidekiq_unique_jobs/lock/client_validator.rb
sidekiq-unique-jobs-7.0.0.beta13 lib/sidekiq_unique_jobs/lock/client_validator.rb
sidekiq-unique-jobs-7.0.0.beta12 lib/sidekiq_unique_jobs/lock/client_validator.rb
sidekiq-unique-jobs-7.0.0.beta11 lib/sidekiq_unique_jobs/lock/client_validator.rb
sidekiq-unique-jobs-7.0.0.beta10 lib/sidekiq_unique_jobs/lock/client_validator.rb
sidekiq-unique-jobs-7.0.0.beta9 lib/sidekiq_unique_jobs/lock/client_validator.rb
sidekiq-unique-jobs-7.0.0.beta8 lib/sidekiq_unique_jobs/lock/client_validator.rb
sidekiq-unique-jobs-7.0.0.beta7 lib/sidekiq_unique_jobs/lock/client_validator.rb
sidekiq-unique-jobs-7.0.0.beta6 lib/sidekiq_unique_jobs/lock/client_validator.rb