aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2020-06-21 09:29:22 +0300
committerGravatar ks129 <[email protected]>2020-06-21 09:29:22 +0300
commit1fd30faaeaa2dfc3e38426db9112628bfdba0f04 (patch)
tree44c610359830783cdebacf3834fd50a8c49c3b3d
parentReddit: Remove unnecessary revoke task name changing (diff)
Reddit: Don't define revoke task as variable but instantly append
-rw-r--r--bot/cogs/reddit.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/bot/cogs/reddit.py b/bot/cogs/reddit.py
index 681d1997f..850d3afb2 100644
--- a/bot/cogs/reddit.py
+++ b/bot/cogs/reddit.py
@@ -44,8 +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():
- task = asyncio.create_task(self.revoke_access_token())
- self.bot.closing_tasks.append(task)
+ self.bot.closing_tasks.append(asyncio.create_task(self.revoke_access_token()))
async def init_reddit_ready(self) -> None:
"""Sets the reddit webhook when the cog is loaded."""