code linted
This commit is contained in:
@@ -42,9 +42,7 @@ def main():
|
||||
cutoff = datetime.now() - timedelta(days=retention_days)
|
||||
|
||||
# Delete attack detections linked to old access logs first (FK constraint)
|
||||
old_log_ids = session.query(AccessLog.id).filter(
|
||||
AccessLog.timestamp < cutoff
|
||||
)
|
||||
old_log_ids = session.query(AccessLog.id).filter(AccessLog.timestamp < cutoff)
|
||||
detections_deleted = (
|
||||
session.query(AttackDetection)
|
||||
.filter(AttackDetection.access_log_id.in_(old_log_ids))
|
||||
|
||||
@@ -40,9 +40,7 @@ def main():
|
||||
|
||||
stats_after = tracker.get_memory_stats()
|
||||
|
||||
visits_reduced = (
|
||||
stats_before["ip_page_visits"] - stats_after["ip_page_visits"]
|
||||
)
|
||||
visits_reduced = stats_before["ip_page_visits"] - stats_after["ip_page_visits"]
|
||||
|
||||
if visits_reduced > 0:
|
||||
app_logger.info(
|
||||
|
||||
Reference in New Issue
Block a user