This commit is contained in:
aozhiwei 2020-10-27 16:33:37 +08:00
parent 422e597052
commit b03c9c5cfc

View File

@ -18,6 +18,11 @@ context = {
'channel': 0,
'dbname_prefix': ''
}
EXCLUDE_KEYS = {
'game2004api:kill_rank_6006': 1,
'game2004api:win_rank_6006': 1,
'game2004api:integral_rank_6006': 1
}
def scanKeys(r, key_prefix, matched_keys):
scan_key = key_prefix + '*'
@ -36,8 +41,15 @@ def scanKeys(r, key_prefix, matched_keys):
break
#end while cursor
def excludeKey(key):
global EXCLUDE_KEYS
return key in EXCLUDE_KEYS
def saveKeys(r, keys, curr_file):
for key in keys:
if excludeKey(key):
print('[WARNING]exclude key ' + key)
continue
data = r.get(key)
expire = r.ttl(key)
curr_file.write(json.dumps(