aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar kwzrd <[email protected]>2020-06-12 14:22:02 +0200
committerGravatar kwzrd <[email protected]>2020-06-12 14:22:02 +0200
commit0f9f25e703325bae172148bb6a30c1118b905fcb (patch)
treec74ee32a7958b86dc3bdf2a330b43ebb482a4f8a
parentIncidents: only `add_signals` if missing (diff)
Incidents: add `event_lock` for simple event synchronization
-rw-r--r--bot/cogs/moderation/incidents.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/bot/cogs/moderation/incidents.py b/bot/cogs/moderation/incidents.py
index 43b1106ad..1cfa45dc4 100644
--- a/bot/cogs/moderation/incidents.py
+++ b/bot/cogs/moderation/incidents.py
@@ -28,8 +28,10 @@ class Incidents(Cog):
"""Automation for the #incidents channel."""
def __init__(self, bot: Bot) -> None:
- """Schedule `crawl_task` on start-up."""
+ """Prepare `event_lock` and schedule `crawl_task` on start-up."""
self.bot = bot
+
+ self.event_lock = asyncio.Lock()
self.crawl_task = self.bot.loop.create_task(self.crawl_incidents())
async def crawl_incidents(self) -> None: