Class: SidekiqUniqueJobs::Lock::ClientValidator
- Inherits:
-
Object
- Object
- SidekiqUniqueJobs::Lock::ClientValidator
- Defined in:
- lib/sidekiq_unique_jobs/lock/client_validator.rb
Overview
Validates the sidekiq options for the Sidekiq client process
Constant Summary collapse
- INVALID_ON_CONFLICTS =
Returns a collection of invalid conflict resolutions.
[:raise, :reject, :reschedule].freeze
Class Method Summary collapse
-
.validate(lock_config) ⇒ Object
Validates the sidekiq options for the Sidekiq client process.
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 |