From 0224e8f395a157158735ad8622d9d1e88985a300 Mon Sep 17 00:00:00 2001 From: RallyBlock <50393307+RallyBlock@users.noreply.github.com> Date: Thu, 22 Oct 2026 20:46:33 -0700 Subject: [PATCH] Keep scanner probes and dropped connections out of the sync log. --- sync/pitlog_sync.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/sync/pitlog_sync.py b/sync/pitlog_sync.py index 9fd4075..51b24f3 100644 --- a/sync/pitlog_sync.py +++ b/sync/pitlog_sync.py @@ -355,6 +355,22 @@ def sync_body(payload, db=None): class Handler(BaseHTTPRequestHandler): protocol_version = "HTTP/1.1" + def handle(self): + try: + super().handle() + except (ConnectionError, TimeoutError): + return + + def send_error(self, code, message=None, explain=None): + try: + self.close_connection = True + self.send_response_only(code) + self.send_header("Content-Length", "0") + self.send_header("Connection", "close") + self.end_headers() + except (ConnectionError, TimeoutError): + self.close_connection = True + def log_message(self, fmt, *args): sys.stdout.write("%s - %s\n" % (self.address_string(), fmt % args))