chg: [stats/top] remove recently added hashes from previously nx hash

This commit is contained in:
Alexandre Dulaunoy 2021-09-05 21:59:20 +02:00
parent 6461b91d55
commit aa58ad8152
Signed by: adulau
GPG key ID: 09E2CD4944E6CBCD

View file

@ -287,6 +287,9 @@ class stattop(Resource):
return {'message': 'Public statistics not enabled'}, 400
ret = {}
ret['nx'] = rdb.zrevrange("s:nx:sha1", 0, 100, withscores=True)
for val in ret['nx']:
if rdb.exists("h:".format(val)):
ret['nx'].remove(val)
exist = rdb.zrevrange("s:exist:sha1", 0, 100, withscores=True)
ret['exist'] = []
for value in exist: