mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 00:51:53 +08:00
kvmd-media server
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
# ========================================================================== #
|
||||
|
||||
|
||||
import asyncio
|
||||
import operator
|
||||
import functools
|
||||
import multiprocessing.queues
|
||||
@@ -64,11 +65,11 @@ def swapped_kvs(dct: dict[_DictKeyT, _DictValueT]) -> dict[_DictValueT, _DictKey
|
||||
|
||||
|
||||
# =====
|
||||
def clear_queue(q: multiprocessing.queues.Queue) -> None: # pylint: disable=invalid-name
|
||||
def clear_queue(q: (multiprocessing.queues.Queue | asyncio.Queue)) -> None: # pylint: disable=invalid-name
|
||||
for _ in range(q.qsize()):
|
||||
try:
|
||||
q.get_nowait()
|
||||
except queue.Empty:
|
||||
except (queue.Empty, asyncio.QueueEmpty):
|
||||
break
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user