mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Implement labels as a set, not array
This commit is contained in:
parent
1b83a15278
commit
a6ba349184
3 changed files with 4 additions and 3 deletions
|
@ -944,7 +944,7 @@ module Sidekiq
|
|||
end
|
||||
|
||||
def labels
|
||||
Array(self["labels"])
|
||||
self["labels"].to_a
|
||||
end
|
||||
|
||||
def [](key)
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
require "forwardable"
|
||||
|
||||
require "set"
|
||||
require "sidekiq/redis_connection"
|
||||
|
||||
module Sidekiq
|
||||
|
@ -8,7 +9,7 @@ module Sidekiq
|
|||
extend Forwardable
|
||||
|
||||
DEFAULTS = {
|
||||
labels: [],
|
||||
labels: Set.new,
|
||||
require: ".",
|
||||
environment: nil,
|
||||
concurrency: 10,
|
||||
|
|
|
@ -241,7 +241,7 @@ module Sidekiq
|
|||
"tag" => @config[:tag] || "",
|
||||
"concurrency" => @config.capsules.map { |cap| cap.concurrency }.sum,
|
||||
"queues" => @config.capsules.map { |cap| cap.queues }.flatten.uniq,
|
||||
"labels" => @config[:labels],
|
||||
"labels" => @config[:labels].to_a,
|
||||
"identity" => identity
|
||||
}
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue