Skip to content

Commit

Permalink
Deal with a changed in mapped_get semantics in redis-rb.
Browse files Browse the repository at this point in the history
Previously the method stripped out keys with nil values, now it returns them, so we need to strip out the keys with nil values.
  • Loading branch information
nirvdrum authored and defunkt committed Feb 3, 2011
1 parent 223c559 commit b51802d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/resque/worker.rb
Expand Up @@ -32,8 +32,13 @@ def self.all
def self.working
names = all
return [] unless names.any?

names.map! { |name| "worker:#{name}" }
redis.mapped_mget(*names).keys.map do |key|

reportedly_working = redis.mapped_mget(*names).reject do |key, value|
value.nil?
end
reportedly_working.keys.map do |key|
find key.sub("worker:", '')
end.compact
end
Expand Down

0 comments on commit b51802d

Please sign in to comment.