From 00d5b181dd6111973bae9518556037c7e3f9efe1 Mon Sep 17 00:00:00 2001 From: Thomas Farstrike Date: Tue, 11 Nov 2025 18:21:38 +0100 Subject: [PATCH] Don't add "None" callbacks to the queue --- internal_filesystem/lib/websocket.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/internal_filesystem/lib/websocket.py b/internal_filesystem/lib/websocket.py index 7a4caba8..e2e92b77 100644 --- a/internal_filesystem/lib/websocket.py +++ b/internal_filesystem/lib/websocket.py @@ -37,13 +37,15 @@ class WebSocketTimeoutException(WebSocketException): _callback_queue = ucollections.deque((), 100) # Empty tuple, maxlen=100 def _run_callback(callback, *args): + if not callback: + print("_run_callback: skipping None callback") + return """Add callback to queue for execution.""" try: _callback_queue.append((callback, args)) _log_debug(f"Queued callback {callback}, args={args}, queue size: {len(_callback_queue)}") - #if callback: - # print("Doing callback directly:") - # callback(*args) + # print("Doing callback directly:") + # callback(*args) except IndexError: _log_error("ERROR: websocket.py callback queue full, dropping callback")