lib/ci/queue/redis/base.rb in ci-queue-0.44.0 vs lib/ci/queue/redis/base.rb in ci-queue-0.45.0
- old
+ new
@@ -116,9 +116,17 @@
transaction.llen(key('queue'))
transaction.zcard(key('running'))
end.inject(:+)
end
+ def remaining
+ redis.llen(key('queue'))
+ end
+
+ def running
+ redis.zcard(key('running'))
+ end
+
def to_a
redis.multi do |transaction|
transaction.lrange(key('queue'), 0, -1)
transaction.zrange(key('running'), 0, -1)
end.flatten.reverse.map { |k| index.fetch(k) }