redis-fix

This commit is contained in:
2024-09-26 17:44:32 +03:00
parent 9412ec1458
commit d8cd8ecb38

View File

@@ -38,7 +38,7 @@ async def messages_routing(msg, state):
scoring_msg_id = mid
pattern = f"toxic:{cid}:{uid}:*"
scores = []
async for key in client.scan_iter(pattern):
async for key in redis.scan_iter(pattern):
scr = int(await redis.get(key))
scores.append(scr)
toxic_score = math.floor(sum(scores)/len(scores)) if scores else 0