aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Boris Muratov <[email protected]>2021-08-03 19:25:04 +0300
committerGravatar GitHub <[email protected]>2021-08-03 19:25:04 +0300
commit62ab2fc8d98e6ff28af8e9ca2944ce705de4ab48 (patch)
tree0d8bba910c7cbb6d3f68cab0f37a27dfc6d3b12b
parentAdd virtual environment (venv) tag (#1702) (diff)
Correctly delete from cache
* Fixed wrong condition in rescheduler which made the eventual consistency not work. * Mods now correctly removed from cache on role reapplies.
-rw-r--r--bot/exts/moderation/modpings.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/bot/exts/moderation/modpings.py b/bot/exts/moderation/modpings.py
index 1ad5005de..29a5c1c8e 100644
--- a/bot/exts/moderation/modpings.py
+++ b/bot/exts/moderation/modpings.py
@@ -44,7 +44,7 @@ class ModPings(Cog):
log.trace("Applying the moderators role to the mod team where necessary.")
for mod in mod_team.members:
if mod in pings_on: # Make sure that on-duty mods aren't in the cache.
- if mod in pings_off:
+ if mod.id in pings_off:
await self.pings_off_mods.delete(mod.id)
continue
@@ -59,6 +59,7 @@ class ModPings(Cog):
"""Reapply the moderator's role to the given moderator."""
log.trace(f"Re-applying role to mod with ID {mod.id}.")
await mod.add_roles(self.moderators_role, reason="Pings off period expired.")
+ await self.pings_off_mods.delete(mod.id)
@group(name='modpings', aliases=('modping',), invoke_without_command=True)
@has_any_role(*MODERATION_ROLES)