mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Style improvements and key checking simplification
This commit is contained in:
parent
b1bc022125
commit
b70c3ef50d
1 changed files with 13 additions and 13 deletions
|
@ -10,21 +10,21 @@ require 'sidekiq/redis_connection'
|
|||
require 'json'
|
||||
|
||||
module Sidekiq
|
||||
NAME = "Sidekiq"
|
||||
NAME = 'Sidekiq'
|
||||
LICENSE = 'See LICENSE and the LGPL-3.0 for licensing details.'
|
||||
|
||||
DEFAULTS = {
|
||||
:queues => [],
|
||||
:labels => [],
|
||||
:concurrency => 25,
|
||||
:require => '.',
|
||||
:environment => nil,
|
||||
:timeout => 8,
|
||||
:error_handlers => [],
|
||||
:lifecycle_events => {
|
||||
:startup => [],
|
||||
:quiet => [],
|
||||
:shutdown => [],
|
||||
queues: [],
|
||||
labels: [],
|
||||
concurrency: 25,
|
||||
require: '.',
|
||||
environment: nil,
|
||||
timeout: 8,
|
||||
error_handlers: [],
|
||||
lifecycle_events: {
|
||||
startup: [],
|
||||
quiet: [],
|
||||
shutdown: [],
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -146,7 +146,7 @@ module Sidekiq
|
|||
# end
|
||||
def self.on(event, &block)
|
||||
raise ArgumentError, "Symbols only please: #{event}" unless event.is_a?(Symbol)
|
||||
raise ArgumentError, "Invalid event name: #{event}" unless options[:lifecycle_events].keys.include?(event)
|
||||
raise ArgumentError, "Invalid event name: #{event}" unless options[:lifecycle_events].key?(event)
|
||||
options[:lifecycle_events][event] << block
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue