fix dups in find rast repeats

This commit is contained in:
Dmitry Belyaev 2025-03-13 11:52:20 +03:00
parent e7c7993b03
commit f59b7ab639
Signed by: b4tman
GPG Key ID: 41A00BF15EA7E5F3

@ -84,7 +84,10 @@ def find_fast_repeats(
infos = sorted(infos, key=lambda info: info.datetime)
for a, b in zip(infos, infos[1:]):
if a.ip == b.ip and b.datetime - a.datetime <= threshold:
result.setdefault(name, []).extend((a, b))
for x in a, b:
lst = result.setdefault(name, [])
if x not in lst:
lst.append(x)
if name in result and len(result[name]) < min_repeats:
result.pop(name)
return result