Commit ec6755a3 authored by 宋柯's avatar 宋柯

redis清理

parent 669389df
...@@ -268,7 +268,7 @@ for key_k in keys: ...@@ -268,7 +268,7 @@ for key_k in keys:
cursor = "0" cursor = "0"
while True: while True:
del_datas = set() del_datas = set()
cursor, data = conn.execute_command("scan {} match {} count {} {}".format(cursor,key,100,node)) cursor, data = conn.execute_command("scan {} match {} count {} {}".format(cursor,key,10,node))
cursor = str(cursor,encoding='utf-8') cursor = str(cursor,encoding='utf-8')
for d in data: for d in data:
dd = str(d, encoding='utf-8') dd = str(d, encoding='utf-8')
...@@ -277,7 +277,7 @@ for key_k in keys: ...@@ -277,7 +277,7 @@ for key_k in keys:
# del_datas.add(str(d, encoding='utf-8')) # del_datas.add(str(d, encoding='utf-8'))
sum += len(data) sum += len(data)
key_sum += len(del_datas) key_sum += len(del_datas)
print(node,cursor, len(data), sum) print("node:{},cursor:{},len(data):{},sum:{}".format(node,cursor, len(data), sum))
break break
# pipline = conn.pipeline() # pipline = conn.pipeline()
# for d in del_datas: # for d in del_datas:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment