From 3159b9c0f563d2183723790d9178b8b945a032cc Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Wed, 9 Jan 2019 19:04:55 +0000 Subject: [PATCH] Dont handle redisqueue if bot decides to offline --- discordbot/titanembeds/redisqueue.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/discordbot/titanembeds/redisqueue.py b/discordbot/titanembeds/redisqueue.py index 6450a7a..562fc0d 100644 --- a/discordbot/titanembeds/redisqueue.py +++ b/discordbot/titanembeds/redisqueue.py @@ -38,6 +38,9 @@ class RedisQueue: await subscriber.subscribe(["discord-api-req"]) count = 0 while True: + if not self.bot.is_ready() or self.bot.is_closed(): + await asyncio.sleep(0) + continue reply = await subscriber.next_published() request = json.loads(reply.value) resource = request["resource"]