Skip to content

Commit 00d5b18

Browse files
Don't add "None" callbacks to the queue
1 parent 0e69359 commit 00d5b18

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

internal_filesystem/lib/websocket.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,15 @@ class WebSocketTimeoutException(WebSocketException):
3737
_callback_queue = ucollections.deque((), 100) # Empty tuple, maxlen=100
3838

3939
def _run_callback(callback, *args):
40+
if not callback:
41+
print("_run_callback: skipping None callback")
42+
return
4043
"""Add callback to queue for execution."""
4144
try:
4245
_callback_queue.append((callback, args))
4346
_log_debug(f"Queued callback {callback}, args={args}, queue size: {len(_callback_queue)}")
44-
#if callback:
45-
# print("Doing callback directly:")
46-
# callback(*args)
47+
# print("Doing callback directly:")
48+
# callback(*args)
4749
except IndexError:
4850
_log_error("ERROR: websocket.py callback queue full, dropping callback")
4951

0 commit comments

Comments
 (0)