diff options
author | 2022-02-22 19:45:34 -0500 | |
---|---|---|
committer | 2022-02-22 19:55:43 -0500 | |
commit | 54480a1a166511c8b85dbb46403247144138fd24 (patch) | |
tree | 82a87813fb7f0e0d785151ef0e8746b5b4933c6e | |
parent | 👌 Fix indentation and update grammar for when only 1 channel remains (diff) |
👌 Only send metric if helpers were notified
-rw-r--r-- | bot/exts/help_channels/_message.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/bot/exts/help_channels/_message.py b/bot/exts/help_channels/_message.py index 39132b0f1..6e986282e 100644 --- a/bot/exts/help_channels/_message.py +++ b/bot/exts/help_channels/_message.py @@ -162,10 +162,9 @@ async def notify_none_remaining(last_notification: Arrow) -> t.Optional[Arrow]: except Exception: # Handle it here cause this feature isn't critical for the functionality of the system. log.exception("Failed to send notification about lack of dormant channels!") - finally: + else: bot.instance.stats.incr("help.out_of_channel_alerts") - - return arrow.utcnow() + return arrow.utcnow() async def notify_running_low(number_of_channels_left: int, last_notification: Arrow) -> t.Optional[Arrow]: @@ -210,10 +209,9 @@ async def notify_running_low(number_of_channels_left: int, last_notification: Ar except Exception: # Handle it here cause this feature isn't critical for the functionality of the system. log.exception("Failed to send notification about running low of dormant channels!") - finally: + else: bot.instance.stats.incr("help.running_low_alerts") - - return arrow.utcnow() + return arrow.utcnow() async def pin(message: discord.Message) -> None: |