Skip to content

Commit dc7d068

Browse files
committed
add logs if adnl connection failed in alerts
1 parent b9c4199 commit dc7d068

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

modules/alert_bot.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ def check_adnl_connection_failed(self):
362362
utils_module = UtilitiesModule(self.ton, self.local)
363363
ok, error = utils_module.check_adnl_connection()
364364
if not ok:
365+
self.local.add_log(error, "warning")
365366
self.send_alert("adnl_connection_failed")
366367

367368
def get_myself_from_election(self, config: dict):

modules/utilities.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,15 +355,15 @@ def check_adnl_connection(self):
355355
response = requests.post(url, json=data, timeout=5).json()
356356
except Exception as e:
357357
ok = False
358-
error = f'{{red}}Failed to check ADNL connection to local node: {type(e)}: {e}{{endc}}'
358+
error = f'Failed to check ADNL connection to local node: {type(e)}: {e}'
359359
continue
360360
result = response.get("ok")
361361
if result:
362362
ok = True
363363
break
364364
if not result:
365365
ok = False
366-
error = f'{{red}}Failed to check ADNL connection to local node: {response.get("message")}{{endc}}'
366+
error = f'Failed to check ADNL connection to local node: {response.get("message")}'
367367
return ok, error
368368

369369
def get_pool_data(self, args):

mytonctrl/mytonctrl.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,7 @@ def check_adnl(local, ton):
488488
utils_module = UtilitiesModule(ton, local)
489489
ok, error = utils_module.check_adnl_connection()
490490
if not ok:
491+
error = "{red}" + error + "{endc}"
491492
print_warning(local, error)
492493
#end define
493494

0 commit comments

Comments
 (0)