Navigation Menu

Skip to content

Commit

Permalink
tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
defunkt committed Sep 22, 2011
1 parent 57bb576 commit 4d530b8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/resque/worker.rb
Expand Up @@ -35,17 +35,17 @@ def self.working

names.map! { |name| "worker:#{name}" }

reportedly_working = begin
redis.mapped_mget(*names).reject do |key, value|
reportedly_working = {}

begin
reportedly_working = redis.mapped_mget(*names).reject do |key, value|
value.nil? || value.empty?
end
rescue Redis::Distributed::CannotDistribute
result = {}
names.each do |name|
value = redis.get name
result[name] = value unless value.nil? || value.empty?
reportedly_working[name] = value unless value.nil? || value.empty?
end
result
end

reportedly_working.keys.map do |key|
Expand Down

0 comments on commit 4d530b8

Please sign in to comment.