Skip to content

Commit 2d7abf5

Browse files
mishina2228PatrickTulskie
authored andcommitted
Show correctly the values of hash and none type on stats tab
1 parent 51f4994 commit 2d7abf5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/resque/server.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ def url_prefix
6767
def redis_get_size(key)
6868
case Resque.redis.type(key)
6969
when 'none'
70-
[]
70+
0
71+
when 'hash'
72+
Resque.redis.hlen(key)
7173
when 'list'
7274
Resque.redis.llen(key)
7375
when 'set'
@@ -83,6 +85,8 @@ def redis_get_value_as_array(key, start=0)
8385
case Resque.redis.type(key)
8486
when 'none'
8587
[]
88+
when 'hash'
89+
Resque.redis.hgetall(key).to_a[start..(start + 20)]
8690
when 'list'
8791
Resque.redis.lrange(key, start, start + 20)
8892
when 'set'

0 commit comments

Comments
 (0)