mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
polish
This commit is contained in:
parent
0039b849c0
commit
89d00fbc8f
3 changed files with 5 additions and 6 deletions
|
@ -121,9 +121,9 @@ module Sidekiq
|
|||
end
|
||||
|
||||
private def local_redis_pool
|
||||
# this is our default client/housekeeping pool. each capsule has its
|
||||
# this is our internal client/housekeeping pool. each capsule has its
|
||||
# own pool for executing threads.
|
||||
@redis ||= new_redis_pool(5, "global")
|
||||
@redis ||= new_redis_pool(5, "internal")
|
||||
end
|
||||
|
||||
def new_redis_pool(size, name = "unset")
|
||||
|
|
|
@ -6,7 +6,6 @@ module Sidekiq
|
|||
class Embedded
|
||||
include Sidekiq::Component
|
||||
|
||||
attr_accessor :config
|
||||
def initialize(config)
|
||||
@config = config
|
||||
end
|
||||
|
@ -14,9 +13,9 @@ module Sidekiq
|
|||
def run
|
||||
housekeeping
|
||||
fire_event(:startup, reverse: false, reraise: true)
|
||||
@launcher = Sidekiq::Launcher.new(@config, true)
|
||||
@launcher = Sidekiq::Launcher.new(@config, embedded: true)
|
||||
@launcher.run
|
||||
sleep 0.1
|
||||
sleep 0.1 # pause to give threads time to spin up
|
||||
|
||||
logger.info "Embedded mode running with #{Thread.list.size} threads"
|
||||
logger.debug { Thread.list.map(&:name) }
|
||||
|
|
|
@ -22,7 +22,7 @@ module Sidekiq
|
|||
|
||||
attr_accessor :managers, :poller
|
||||
|
||||
def initialize(config, embedded = false)
|
||||
def initialize(config, embedded: false)
|
||||
@config = config
|
||||
@embedded = embedded
|
||||
@managers = config.capsules.values.map do |cap|
|
||||
|
|
Loading…
Add table
Reference in a new issue