INNER CODE UNIT · Python
_update_ip_stats
BlessedRebuS/Krawl · src/database/core.py:619
def _update_ip_stats(
self,
session: Session,
ip: str,
is_suspicious: bool = False,
is_honeypot_trigger: bool = False,
increment_page_visit: bool = False,
max_pages_limit: int = 0,
):
"""
Update IP statistics (upsert pattern).
Args:
session: Active database session
ip: IP address to update
is_suspicious: Whether the request was flagged as suspicious
increment_page_visit: Also increment page visit counter
max_pages_limit: Ban threshold (only used when increment_page_visit=True)