mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Use mset instead of a loop over set for Stats#reset.
This commit is contained in:
parent
b47bbbc2a6
commit
ff9475096c
1 changed files with 6 additions and 1 deletions
|
@ -15,8 +15,13 @@ module Sidekiq
|
|||
all = %w(failed processed)
|
||||
stats = stats.empty? ? all : all & stats.flatten.compact.map(&:to_s)
|
||||
|
||||
mset_args = []
|
||||
stats.each do |stat|
|
||||
mset_args << "stat:#{stat}"
|
||||
mset_args << 0
|
||||
end
|
||||
Sidekiq.redis do |conn|
|
||||
stats.each { |stat| conn.set("stat:#{stat}", 0) }
|
||||
conn.mset(*mset_args)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue