From 71adbe26053ab71f90962d414b0182df81f98a85 Mon Sep 17 00:00:00 2001 From: Lorenzo Venerandi Date: Sun, 22 Feb 2026 17:57:06 +0100 Subject: [PATCH] feat: refine IP reevaluation logic to include unanalyzed addresses --- src/database.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/database.py b/src/database.py index 789aa29..5f0c056 100644 --- a/src/database.py +++ b/src/database.py @@ -790,16 +790,22 @@ class DatabaseManager: def get_ips_needing_reevaluation(self) -> List[str]: """ - Get all IP addresses that have been flagged for reevaluation. + Get all IP addresses that need evaluation. Returns: List of IP addresses where need_reevaluation is True + or that have never been analyzed (last_analysis is NULL) """ session = self.session try: ips = ( session.query(IpStats.ip) - .filter(IpStats.need_reevaluation == True) + .filter( + or_( + IpStats.need_reevaluation == True, + IpStats.last_analysis.is_(None), + ) + ) .all() ) return [ip[0] for ip in ips]