aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Numerlor <[email protected]>2020-02-26 18:20:19 +0100
committerGravatar Numerlor <[email protected]>2020-02-26 18:20:19 +0100
commitf779f60b5376872043eda8c25712f0dd2a451a78 (patch)
treee381eae4dda61579968416c55b0425d6602211c8
parentCheck for falsy values instead of ``""` and `None` explicitly. (diff)
Fix comparison operator when checking token expiration.
With `<` the check only went through when the token was already expired, making revoking redundant; and didn't go through when the token still had some time before expiration.
-rw-r--r--bot/cogs/reddit.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/bot/cogs/reddit.py b/bot/cogs/reddit.py
index 6d03928e0..5a7fa100f 100644
--- a/bot/cogs/reddit.py
+++ b/bot/cogs/reddit.py
@@ -43,7 +43,7 @@ class Reddit(Cog):
def cog_unload(self) -> None:
"""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():
+ if self.access_token and self.access_token.expires_at > datetime.utcnow():
asyncio.create_task(self.revoke_access_token())
async def init_reddit_ready(self) -> None: