Class: SidekiqUniqueJobs::Lock::ClientValidator

Inherits:
Object
  • Object
show all
Defined in:
lib/sidekiq_unique_jobs/lock/client_validator.rb

Overview

Validates the sidekiq options for the Sidekiq client process

Author:

Constant Summary collapse

INVALID_ON_CONFLICTS =

Returns a collection of invalid conflict resolutions.

Returns:

  • (Array<Symbol>)

    a collection of invalid conflict resolutions

[:raise, :reject, :reschedule].freeze

Class Method Summary collapse

Class Method Details

.validate(lock_config) ⇒ Object

Validates the sidekiq options for the Sidekiq client process



19
20
21
22
23
24
25
# File 'lib/sidekiq_unique_jobs/lock/client_validator.rb', line 19

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