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

Improvement for stopping in case of first connection failed

This commit is contained in:
imbeacon
2024-05-29 08:58:04 +03:00
parent 27f5852388
commit 81e3eb62d5

View File

@@ -243,6 +243,8 @@ class TBGatewayService:
log.exception(e) log.exception(e)
self.tb_client.register_service_subscription_callback(self.subscribe_to_required_topics) self.tb_client.register_service_subscription_callback(self.subscribe_to_required_topics)
self.tb_client.connect() self.tb_client.connect()
if self.stopped:
return
if logging_error is not None: if logging_error is not None:
self.tb_client.client.send_telemetry({"ts": time() * 1000, "values": { self.tb_client.client.send_telemetry({"ts": time() * 1000, "values": {
"LOGS": "Logging loading exception, logs.json is wrong: %s" % (str(logging_error),)}}) "LOGS": "Logging loading exception, logs.json is wrong: %s" % (str(logging_error),)}})