From 034d2a5adc29a039d6b50bdd58e680f4d5de8485 Mon Sep 17 00:00:00 2001 From: imbeacon Date: Mon, 14 Oct 2024 09:48:53 +0300 Subject: [PATCH] Fix for setting max queue size --- tb_device_mqtt.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tb_device_mqtt.py b/tb_device_mqtt.py index cf5716b..7707983 100644 --- a/tb_device_mqtt.py +++ b/tb_device_mqtt.py @@ -646,7 +646,10 @@ def max_inflight_messages_set(self, inflight): def max_queued_messages_set(self, queue_size): """Set the maximum number of outgoing messages with QoS>0 that can be pending in the outgoing message queue. Defaults to 0. 0 means unlimited. When the queue is full, any further outgoing messages would be dropped.""" - self._client.max_queued_messages_set(queue_size) + if queue_size < 0: + raise ValueError("Invalid queue size.") + + self._client._max_queued_messages = queue_size def reconnect_delay_set(self, min_delay=1, max_delay=120): """The client will automatically retry connection. Between each attempt it will wait a number of seconds