Skip to content

Commit c1e236a

Browse files
committed
Add comment about queue rate limiting
1 parent f834e20 commit c1e236a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

plugwise_usb/connection/queue.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ async def _send_queue_worker(self) -> None:
145145

146146
qsize = self._submit_queue.qsize()
147147
if qsize > 3:
148+
# When the queue size grows, rate-limit the sending of requests to avoid overloading the network
148149
await sleep(0.125)
149150
if qsize > 3:
150151
_LOGGER.warning("Awaiting plugwise responses %d", qsize)

0 commit comments

Comments
 (0)