fix: Force connection close to prevent stale connections in scheduler

Added 'Connection: close' header to bridge requests to prevent
connection pooling issues when running from APScheduler background
thread context.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
MarekWo
2026-01-30 12:28:41 +01:00
parent 2a187133ec
commit 2bb2d02476

View File

@@ -43,6 +43,7 @@ def _run_command(args: list, timeout: int = DEFAULT_TIMEOUT) -> Tuple[bool, str,
'args': args,
'timeout': timeout
},
headers={'Connection': 'close'}, # Prevent connection reuse issues in background threads
timeout=timeout + 5 # Add 5s buffer for HTTP timeout
)