aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar minalike <[email protected]>2022-02-22 20:08:29 -0500
committerGravatar minalike <[email protected]>2022-02-22 20:08:29 -0500
commit6c7444d6f61fe201f97673de435a63d4b4f67c7d (patch)
tree30cdc243359ac5289b9c8d56cd20125f3e082b0e
parent👌 Only send metric if helpers were notified (diff)
🐛 Fix to correctly calculate number of seconds from last notification
total_seconds() is the correct method to obtain a time delta in seconds
-rw-r--r--bot/exts/help_channels/_message.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/bot/exts/help_channels/_message.py b/bot/exts/help_channels/_message.py
index 6e986282e..0aabb9bfb 100644
--- a/bot/exts/help_channels/_message.py
+++ b/bot/exts/help_channels/_message.py
@@ -139,7 +139,7 @@ async def notify_none_remaining(last_notification: Arrow) -> t.Optional[Arrow]:
if not constants.HelpChannels.notify_none_remaining:
return None
- if (arrow.utcnow() - last_notification).seconds < (constants.HelpChannels.notify_minutes * 60):
+ if (arrow.utcnow() - last_notification).total_seconds() < (constants.HelpChannels.notify_minutes * 60):
log.trace("Did not send none_remaining notification as it hasn't been enough time since the last one.")
return None
@@ -188,7 +188,7 @@ async def notify_running_low(number_of_channels_left: int, last_notification: Ar
log.trace("Did not send notify_running_low notification as the threshold was not met.")
return None
- if (arrow.utcnow() - last_notification).seconds < (constants.HelpChannels.notify_minutes * 60):
+ if (arrow.utcnow() - last_notification).total_seconds() < (constants.HelpChannels.notify_minutes * 60):
log.trace("Did not send notify_running_low notification as it hasn't been enough time since the last one.")
return None