Skip to content

Commit b51802d

Browse files
nirvdrumdefunkt
authored andcommitted
Deal with a changed in mapped_get semantics in redis-rb.
Previously the method stripped out keys with nil values, now it returns them, so we need to strip out the keys with nil values.
1 parent 223c559 commit b51802d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/resque/worker.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,13 @@ def self.all
3232
def self.working
3333
names = all
3434
return [] unless names.any?
35+
3536
names.map! { |name| "worker:#{name}" }
36-
redis.mapped_mget(*names).keys.map do |key|
37+
38+
reportedly_working = redis.mapped_mget(*names).reject do |key, value|
39+
value.nil?
40+
end
41+
reportedly_working.keys.map do |key|
3742
find key.sub("worker:", '')
3843
end.compact
3944
end

0 commit comments

Comments
 (0)