Skip to content

Commit 2f42201

Browse files
committed
fix lint
1 parent 6f6442f commit 2f42201

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

dash/backends/ws.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ async def _process_ws_message(
254254
send_text: Callable[[str], Any],
255255
messages: list[str],
256256
batch_delay: float,
257-
) -> bool | None:
257+
) -> bool:
258258
"""Process a single WebSocket message from the queue.
259259
260260
Args:
@@ -264,28 +264,25 @@ async def _process_ws_message(
264264
batch_delay: Batch delay in seconds
265265
266266
Returns:
267-
True to continue processing, False to stop the sender loop,
268-
None to continue (same as True but used for continue semantics).
267+
True to continue processing, False to stop the sender loop.
269268
"""
270269
timeout = batch_delay if messages else None
271270
try:
272271
msg = await asyncio.wait_for(q.get(), timeout=timeout)
273272
except asyncio.TimeoutError:
274-
if not await _send_batched(send_text, messages):
275-
return False
273+
success = await _send_batched(send_text, messages)
276274
messages.clear()
277-
return True
275+
return success
278276

279277
if msg == SHUTDOWN_SIGNAL:
280278
if messages:
281279
await _send_batched(send_text, messages)
282280
return False
283281

284282
if msg == FLUSH_SIGNAL:
285-
if messages and not await _send_batched(send_text, messages):
286-
return False
283+
success = not messages or await _send_batched(send_text, messages)
287284
messages.clear()
288-
return None
285+
return success
289286

290287
if not batch_delay:
291288
try:

0 commit comments

Comments
 (0)