Skip to content

Commit 3c3e4fc

Browse files
author
Jim Bennett
committed
Improving runtime memory usage with large data blocks
1 parent 8c0b6a5 commit 3c3e4fc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

adafruit_azureiot/iot_mqtt.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ def _handle_direct_method(self, msg: str, topic: str) -> None:
235235
method_name = topic[len_temp : topic.find("/", len_temp + 1)]
236236

237237
ret = self._callback.direct_method_invoked(method_name, msg)
238+
gc.collect()
238239

239240
ret_code = 200
240241
ret_message = "{}"
@@ -261,13 +262,14 @@ def _handle_cloud_to_device_message(self, msg: str, topic: str) -> None:
261262
properties[key_value[0]] = key_value[1]
262263

263264
self._callback.cloud_to_device_message_received(msg, properties)
265+
gc.collect()
264266

265267
# pylint: disable=W0702, R0912
266268
def _on_message(self, client, msg_topic, payload) -> None:
267269
topic = ""
268270
msg = None
269271

270-
self._logger.info("- iot_mqtt :: _on_message :: payload(" + str(payload) + ")")
272+
self._logger.info("- iot_mqtt :: _on_message")
271273

272274
if payload is not None:
273275
try:

0 commit comments

Comments
 (0)