fix: correct logic for flagging stale IPs for reevaluation based on last_seen timestamp
This commit is contained in:
@@ -815,7 +815,7 @@ class DatabaseManager:
|
|||||||
def flag_stale_ips_for_reevaluation(self) -> int:
|
def flag_stale_ips_for_reevaluation(self) -> int:
|
||||||
"""
|
"""
|
||||||
Flag IPs for reevaluation where:
|
Flag IPs for reevaluation where:
|
||||||
- last_seen is older than the configured retention period
|
- last_seen is newer than the configured retention period
|
||||||
- last_analysis is more than 5 days ago
|
- last_analysis is more than 5 days ago
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
@@ -833,7 +833,7 @@ class DatabaseManager:
|
|||||||
count = (
|
count = (
|
||||||
session.query(IpStats)
|
session.query(IpStats)
|
||||||
.filter(
|
.filter(
|
||||||
IpStats.last_seen <= last_seen_cutoff,
|
IpStats.last_seen >= last_seen_cutoff,
|
||||||
IpStats.last_analysis <= last_analysis_cutoff,
|
IpStats.last_analysis <= last_analysis_cutoff,
|
||||||
IpStats.need_reevaluation == False,
|
IpStats.need_reevaluation == False,
|
||||||
IpStats.manual_category == False,
|
IpStats.manual_category == False,
|
||||||
|
|||||||
Reference in New Issue
Block a user