aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Numerlor <[email protected]>2020-11-11 18:23:01 +0100
committerGravatar Numerlor <[email protected]>2020-11-15 03:12:04 +0100
commitd936e5bc049e2e93beca3c62430d048d9f9cf47b (patch)
tree2edfa1f6cdbf2fbd8d852fec4b80e4fb05247eb7
parentAdjust unparseable symbol behaviour (diff)
Cancel scheduled inventory updates on all refreshes
-rw-r--r--bot/exts/info/doc/_cog.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/bot/exts/info/doc/_cog.py b/bot/exts/info/doc/_cog.py
index fa59bcc42..822f682bf 100644
--- a/bot/exts/info/doc/_cog.py
+++ b/bot/exts/info/doc/_cog.py
@@ -250,6 +250,8 @@ class DocCog(commands.Cog):
async def refresh_inventory(self) -> None:
"""Refresh internal documentation inventory."""
log.debug("Refreshing documentation inventory...")
+ for inventory in self.scheduled_inventories:
+ self.inventory_scheduler.cancel(inventory)
# Clear the old base URLS and doc symbols to ensure
# that we start from a fresh local dataset.
@@ -418,9 +420,6 @@ class DocCog(commands.Cog):
"""
await self.bot.api_client.delete(f'bot/documentation-links/{package_name}')
- if package_name in self.scheduled_inventories:
- self.inventory_scheduler.cancel(package_name)
-
async with ctx.typing():
# Rebuild the inventory to ensure that everything
# that was from this package is properly deleted.
@@ -431,9 +430,6 @@ class DocCog(commands.Cog):
@commands.has_any_role(*MODERATION_ROLES)
async def refresh_command(self, ctx: commands.Context) -> None:
"""Refresh inventories and send differences to channel."""
- for inventory in self.scheduled_inventories:
- self.inventory_scheduler.cancel(inventory)
-
old_inventories = set(self.base_urls)
with ctx.typing():
await self.refresh_inventory()