File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -57,9 +57,10 @@ def enumerate_keys
5757 loop do
5858 sock . send ( "stats cachedump #{ sid } #{ max_keys } \r \n " , 0 )
5959 data = sock . recv ( 4096 )
60- break if !data || data . length == 0 || data == "END\r \n "
60+ break if !data || data . length == 0 || data == "END\r \n " || data == "ERROR \r \n "
6161 matches = data . scan ( /^ITEM (?<key>.*) \[ / )
62- keys = keys + matches . flatten! if matches
62+ break if matches . empty?
63+ keys = keys + matches . flatten!
6364 break if data =~ /^END/
6465 end
6566 end
@@ -86,9 +87,10 @@ def enumerate_keys_lru
8687 sock . send ( "lru_crawler metadump all\r \n " , 0 )
8788 loop do
8889 data = sock . recv ( 4096 )
89- break if !data || data . length == 0 || data == "END\r \n "
90+ break if !data || data . length == 0 || data == "END\r \n " || data == "ERROR \r \n "
9091 matches = data . scan ( /^key=(?<key>.*) exp=/ )
91- keys = keys + matches . flatten! if matches
92+ break if matches . empty?
93+ keys = keys + matches . flatten!
9294 break if data =~ /^END/
9395 data = ''
9496 end
You can’t perform that action at this time.
0 commit comments