Skip to content

Commit

Permalink
rename vars to fix mypy incompatible types error
Browse files Browse the repository at this point in the history
  • Loading branch information
mourginakis committed Oct 25, 2023
1 parent ad12050 commit 38630cd
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions node_monitor/node_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,16 +119,16 @@ def broadcast_alerts(self) -> None:
if self.slack_bot is not None:
channel_name = channels[node_provider_id]['slack_channel_name']
logging.info(f"Sending alert slack message to {channel_name}...")
err = self.slack_bot.send_message(channel_name, message)
if err is not None:
logging.error(f"SlackBot.send_message() failed with error: {err}")
err1 = self.slack_bot.send_message(channel_name, message)
if err1 is not None:
logging.error(f"SlackBot.send_message() failed with error: {err1}")
if preferences['notify_telegram_chat'] == True:
if self.telegram_bot is not None:
chat_id = channels[node_provider_id]['telegram_chat_id']
logging.info(f"Sending alert telegram message to {chat_id}...")
err = self.telegram_bot.send_message(chat_id, message)
if err is not None:
logging.error(f"TelegramBot.send_message() failed with error: {err}")
err2 = self.telegram_bot.send_message(chat_id, message)
if err2 is not None:
logging.error(f"TelegramBot.send_message() failed with error: {err2}")
# - - - - - - - - - - - - - - - - -


Expand Down Expand Up @@ -162,16 +162,16 @@ def broadcast_status_report(self) -> None:
if self.slack_bot is not None:
channel_name = channels[node_provider_id]['slack_channel_name']
logging.info(f"Sending status report slack message to {channel_name}...")
err = self.slack_bot.send_message(channel_name, message)
if err is not None:
logging.error(f"SlackBot.send_message() failed with error: {err}")
err1 = self.slack_bot.send_message(channel_name, message)
if err1 is not None:
logging.error(f"SlackBot.send_message() failed with error: {err1}")
if preferences['notify_telegram_chat'] == True:
if self.telegram_bot is not None:
chat_id = channels[node_provider_id]['telegram_chat_id']
logging.info(f"Sending status report telegram message to {chat_id}...")
err = self.telegram_bot.send_message(chat_id, message)
if err is not None:
logging.error(f"TelegramBot.send_message() failed with error: {err}")
err2 = self.telegram_bot.send_message(chat_id, message)
if err2 is not None:
logging.error(f"TelegramBot.send_message() failed with error: {err2}")
# - - - - - - - - - - - - - - - - -


Expand Down

0 comments on commit 38630cd

Please sign in to comment.