Skip to content

Commit fe902b8

Browse files
committed
prevent tight loop on queue depth
1 parent 5d2a67e commit fe902b8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

plugwise_usb/connection/queue.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,10 @@ async def _send_queue_worker(self) -> None:
137137
self._submit_queue.task_done()
138138
return
139139

140-
while self._stick.queue_depth > 3:
141-
_LOGGER.info("Awaiting plugwise responses %d", self._stick.queue_depth)
140+
if self._stick.queue_depth > 3:
142141
await sleep(0.125)
142+
if self._stick.queue_depth > 3:
143+
_LOGGER.warning("Awaiting plugwise responses %d", self._stick.queue_depth)
143144

144145
await self._stick.write_to_stick(request)
145146
self._submit_queue.task_done()

0 commit comments

Comments
 (0)