Skip to content

Commit

Permalink
update process script
Browse files Browse the repository at this point in the history
  • Loading branch information
superstes committed Oct 13, 2024
1 parent b8f6a59 commit 7cc24f1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions process_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,15 @@
try:
# pylint: disable=C0103
if r['v'] == 4:
ip = str(IPv4Address(r['ip']))
r['ip'] = str(IPv4Address(r['ip']))

else:
ip = str(IPv6Address(r['ip']))
r['ip'] = str(IPv6Address(r['ip']))

except AddressValueError:
continue

r['ip'] = ip
k = f"{r['by']}_{ip}"
k = f"{r['by']}_{r['ip']}"

# skip if the same reporter has already reported this exact IP in the last N seconds
if k in last_hits and r['time'] < (last_hits[k] + REPORT_COOLDOWN):
Expand Down

0 comments on commit 7cc24f1

Please sign in to comment.