Speed up packing
The .get() function raises a queue.Empty exception anyway, so there was no real need for the .empty() call. Furthermore, it turned out to really slow things down.
This commit is contained in:
parent
7e4fa34aae
commit
44c4ce3a69
@ -130,7 +130,7 @@ class ThreadSafeCallback(Callback):
|
|||||||
def flush(self, timeout: float = None) -> None:
|
def flush(self, timeout: float = None) -> None:
|
||||||
"""Call the queued calls, call this in the main thread."""
|
"""Call the queued calls, call this in the main thread."""
|
||||||
|
|
||||||
while not self._reporting_queue.empty():
|
while True:
|
||||||
try:
|
try:
|
||||||
call = self._reporting_queue.get(block=timeout is not None,
|
call = self._reporting_queue.get(block=timeout is not None,
|
||||||
timeout=timeout)
|
timeout=timeout)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user