mirror of
https://github.com/thingsboard/thingsboard-gateway
synced 2025-10-26 22:31:42 +08:00
Increased default keepalive to avoid continious reconnection
This commit is contained in:
@@ -116,7 +116,7 @@ class TBClient(threading.Thread):
|
||||
self.__min_reconnect_delay = min_reconnect_delay
|
||||
|
||||
def run(self):
|
||||
keep_alive = self.__config.get("keep_alive", 60)
|
||||
keep_alive = self.__config.get("keep_alive", 120)
|
||||
try:
|
||||
while not self.client.is_connected() and not self.__stopped:
|
||||
if not self.__paused:
|
||||
@@ -130,7 +130,7 @@ class TBClient(threading.Thread):
|
||||
pass
|
||||
except Exception as e:
|
||||
log.exception(e)
|
||||
time.sleep(1)
|
||||
time.sleep(.01)
|
||||
except Exception as e:
|
||||
log.exception(e)
|
||||
time.sleep(10)
|
||||
|
||||
@@ -214,6 +214,7 @@ class TBGatewayService:
|
||||
log.info("Stopping...")
|
||||
self.__close_connectors()
|
||||
log.info("The gateway has been stopped.")
|
||||
self.tb_client.disconnect()
|
||||
self.tb_client.stop()
|
||||
|
||||
def __init_remote_configuration(self, force=False):
|
||||
|
||||
Reference in New Issue
Block a user