improve speed of detect post vote manipulation detection - avoid duplicate checking #343

This commit is contained in:
rimu 2024-12-23 13:52:32 +13:00
parent 2db664d9b5
commit 2e32deacd0

View file

@ -476,6 +476,7 @@ def register(app):
current_user_upvotes = set(current_user_upvoted_posts + current_user_upvoted_replies) current_user_upvotes = set(current_user_upvoted_posts + current_user_upvoted_replies)
if len(current_user_upvotes) > 12: if len(current_user_upvotes) > 12:
print(i)
for j in range(i + 1, len(all_user_ids)): for j in range(i + 1, len(all_user_ids)):
other_user_id = all_user_ids[j] other_user_id = all_user_ids[j]
if jaccard_similarity(current_user_upvotes, other_user_id) >= 95: if jaccard_similarity(current_user_upvotes, other_user_id) >= 95: