Skip to content

Commit

Permalink
Fix false positives in domain monitoring module
Browse files Browse the repository at this point in the history
Corrected the issue causing false positives in the domain monitoring module.
  • Loading branch information
ygalnezri authored Jun 27, 2024
1 parent a767f76 commit 2113aad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Watcher/Watcher/site_monitoring/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ def create_alert(alert, site, new_ip, new_ip_second, score):
last_two_alerts = Alert.objects.filter(site=site, created_at__gte=one_hour_ago, created_at__lte=now).order_by('-created_at')[:2]

# Check if the new alert is identical to the last two alerts created at the exact same time
for previous_alert in last_two_alerts:
for previous_alert in last_two_alerts:
if all(getattr(previous_alert, key) == value for key, value in alert_data.items()) and previous_alert.created_at == now:
return

Expand Down Expand Up @@ -450,4 +450,4 @@ def send_email(message, rtir, alert_id):
for email in emails_to:
print(str(timezone.now()) + " - Email sent to ", email)
else:
print(str(timezone.now()) + " - No subscriber, no email sent.")
print(str(timezone.now()) + " - No subscriber, no email sent.")

0 comments on commit 2113aad

Please sign in to comment.