diff options
| author | 2020-02-26 08:42:30 +0100 | |
|---|---|---|
| committer | 2020-02-26 08:42:30 +0100 | |
| commit | d91f821fccfa61f324489baff5debbebb3adbb51 (patch) | |
| tree | bdececab18c8f52e7f04ba6123be7161e07275ec | |
| parent | Make sure token exists before checking its expiration. (diff) | |
Create task for `revoke_access_token` when unloading cog to ensure it's executed.
| -rw-r--r-- | bot/cogs/reddit.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bot/cogs/reddit.py b/bot/cogs/reddit.py index 982c0cbe6..6fe7f820b 100644 --- a/bot/cogs/reddit.py +++ b/bot/cogs/reddit.py @@ -44,7 +44,7 @@ class Reddit(Cog): """Stop the loop task and revoke the access token when the cog is unloaded.""" self.auto_poster_loop.cancel() if self.access_token and self.access_token.expires_at < datetime.utcnow(): - self.revoke_access_token() + asyncio.create_task(self.revoke_access_token()) async def init_reddit_ready(self) -> None: """Sets the reddit webhook when the cog is loaded.""" |