Class: SidekiqUniqueJobs::Lock::ServerValidator

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

Overview

Validates the sidekiq options for the Sidekiq server process

Author:

Constant Summary collapse

INVALID_ON_CONFLICTS =

Returns a collection of invalid conflict resolutions.

Returns:

  • (Array<Symbol>)

    a collection of invalid conflict resolutions

[:replace].freeze

Class Method Summary collapse

Class Method Details

.validate(lock_config) ⇒ Object

Validates the sidekiq options for the Sidekiq server process



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

def self.validate(lock_config)
  on_conflict = lock_config.on_server_conflict
  return lock_config unless INVALID_ON_CONFLICTS.include?(on_conflict)

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