1
0
mirror of https://github.com/thingsboard/thingsboard-gateway synced 2025-10-26 22:31:42 +08:00

Fixed Gateway reconnection to TB

This commit is contained in:
samson0v
2021-10-13 10:45:54 +03:00
parent c3d4707612
commit d6a3f3d7c0

View File

@@ -89,6 +89,10 @@ class TBGatewayService:
self.__rpc_requests_in_progress = {}
self.__connected_devices_file = "connected_devices.json"
self.tb_client = TBClient(self.__config["thingsboard"], self._config_dir)
try:
self.tb_client.disconnect()
except Exception as e:
log.exception(e)
self.tb_client.connect()
self.subscribe_to_required_topics()
self.__subscribed_to_rpc_topics = True