Skip to content

Commit

Permalink
Setup the slack & email channel only during production run
Browse files Browse the repository at this point in the history
The slack bot & email notifications will be setup only when the sim_mode flag is off!
If you are working offline, on your personal PC, then the slackbot & email channels wont be setup
  • Loading branch information
hrushikesh-s committed Mar 7, 2024
1 parent fdbe4b1 commit e79b353
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions alab_management/alarm.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ def __init__(
self.sim_mode_flag = AlabOSConfig().is_sim_mode()
self.email_alert = False
self.slack_alert = False
if email_receivers is not None:
if email_receivers is not None and self.sim_mode_flag is False:
try:
self.setup_email(email_sender, email_receivers, email_password)
self.email_alert = True
except: # noqa: E722
print("Email setup failed, please recheck config file")
if slack_bot_token is not None:
if slack_bot_token is not None and self.sim_mode_flag is False:
try:
self.setup_slackbot(slack_bot_token, slack_channel_id)
self.slack_alert = True
Expand Down

0 comments on commit e79b353

Please sign in to comment.