From 434122493b97fbe0d362e0783e8fc695ca00213b Mon Sep 17 00:00:00 2001 From: Ygal Nezri <155719988+ygalnezri@users.noreply.github.com> Date: Wed, 3 Jul 2024 17:34:05 +0200 Subject: [PATCH] Fix false positives in domain monitoring module Corrected the issue causing false positives in the domain monitoring module. --- Watcher/Watcher/site_monitoring/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Watcher/Watcher/site_monitoring/core.py b/Watcher/Watcher/site_monitoring/core.py index 09ef9ff..602836b 100644 --- a/Watcher/Watcher/site_monitoring/core.py +++ b/Watcher/Watcher/site_monitoring/core.py @@ -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