diff options
| author | 2021-05-09 22:21:03 +0100 | |
|---|---|---|
| committer | 2021-05-09 22:21:03 +0100 | |
| commit | c7eb358cf6e747ea30acbd349597814349961459 (patch) | |
| tree | 6f6f048ba3025dae846b1577396052e68a7d238c | |
| parent | Type hint the Metabase cog! (diff) | |
Move a long comment in Metabse cog into the func doc string
Co-authored-by: Xithrius <[email protected]>
| -rw-r--r-- | bot/exts/moderation/metabase.py | 13 | 
1 files changed, 8 insertions, 5 deletions
diff --git a/bot/exts/moderation/metabase.py b/bot/exts/moderation/metabase.py index e1531c467..db5f04d83 100644 --- a/bot/exts/moderation/metabase.py +++ b/bot/exts/moderation/metabase.py @@ -159,11 +159,14 @@ class Metabase(Cog):          return all(checks)      def cog_unload(self) -> None: -        """Cancel the init task and scheduled tasks.""" -        # It's important to wait for init_task to be cancelled before cancelling scheduled -        # tasks. Otherwise, it's possible for _session_scheduler to schedule another task -        # after cancel_all has finished, despite _init_task.cancel being called first. -        # This is cause cancel() on its own doesn't block until the task is cancelled. +        """ +        Cancel the init task and scheduled tasks. + +        It's important to wait for init_task to be cancelled before cancelling scheduled +        tasks. Otherwise, it's possible for _session_scheduler to schedule another task +        after cancel_all has finished, despite _init_task.cancel being called first. +        This is cause cancel() on its own doesn't block until the task is cancelled. +        """          self.init_task.cancel()          self.init_task.add_done_callback(lambda _: self._session_scheduler.cancel_all())  |