From 18c13862ad653b0ba845d1951868a495c469c13a Mon Sep 17 00:00:00 2001 From: Phxntxm Date: Fri, 7 Oct 2016 20:54:46 -0500 Subject: [PATCH] Corrected when to await for the post task --- cogs/da.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cogs/da.py b/cogs/da.py index b935c99..3761d7a 100644 --- a/cogs/da.py +++ b/cogs/da.py @@ -14,8 +14,6 @@ class Deviantart: self.headers = {"User-Agent": "Bonfire/1.0.0"} self.session = aiohttp.ClientSession() bot.loop.create_task(self.token_task()) - # Lets start the task a few seconds after, to ensure our token gets set - await asyncio.sleep(5) bot.loop.create_task(self.post_task()) async def token_task(self): @@ -25,6 +23,8 @@ class Deviantart: async def post_task(self): + await asyncio.sleep(5) + # Lets start the task a few seconds after, to ensure our token gets set while(True): expires_in = await check_posts() await asyncio.sleep(300)