lib/rector/backends/redis.rb in rector-0.0.1 vs lib/rector/backends/redis.rb in rector-0.0.2
- old
+ new
@@ -1,5 +1,7 @@
+require "set"
+
module Rector
module Backends
class Redis
KEY_LIST_SET = "__keys__"
WORKER_LIST_SET = "__workers__"
@@ -10,19 +12,19 @@
@job_id = job_id
end
def update_job_data_from_hash(hsh)
redis.multi do
- redis.sadd(KEY_LIST_SET, *hsh.keys)
+ redis.sadd(KEY_LIST_SET, hsh.keys)
hsh.each do |key, val|
case val
when Numeric
redis.incrby(key, val)
when Set
- redis.sadd(key, *val)
+ redis.sadd(key, val.to_a)
when Enumerable
- redis.rpush(key, *val)
+ redis.rpush(key, val)
end
end
end
end