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 Jul 3, 2024
1 parent 8ba2682 commit 4341224
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 @@ -364,8 +364,8 @@ def create_alert(alert, site, new_ip, new_ip_second, score):
# Get current time
now = datetime.now()

# Retrieve the two latest alerts for this site within the last hour
one_hour_ago = now - timedelta(hours=1)
# Retrieve the two latest alerts for this site within the last three hours
one_hour_ago = now - timedelta(hours=3)
last_two_alerts = Alert.objects.filter(site=site, created_at__gte=one_hour_ago).order_by('-created_at')[:2]

# Check if the information of the new alert is identical to the last two alerts
Expand Down

0 comments on commit 4341224

Please sign in to comment.