-
Notifications
You must be signed in to change notification settings - Fork 854
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed TBClient reconnecting #1337
Conversation
|
||
connection_logger = getLogger('tb_connection') | ||
new_tb_client = TBClient(config, old_tb_client.get_config_folder_path(), connection_logger) | ||
while self._gateway.tb_client.client.is_connected(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This loop can cause the gateway stuck, probably, it will be better to add check is the gateway stopped or no, to avoid hold before stop.
|
||
connection_state = False | ||
use_new_config = True | ||
while not connection_state: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add check for gateway status - is it stopped or no.
self._gateway.__subscribed_to_rpc_topics = False | ||
new_tb_client = TBClient(config if use_new_config else old_tb_client_config, old_tb_client_config_path, connection_logger) | ||
new_tb_client.connect() | ||
while time() - apply_start <= 30 and not connection_state: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check is gateway running will be nice here as well.
else: | ||
new_tb_client.disconnect() | ||
new_tb_client.stop() | ||
while new_tb_client.client.is_connected(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a check is gateway running or stopped.
No description provided.