Dont handle redisqueue if bot decides to offline

This commit is contained in:
Jeremy Zhang 2019-01-09 19:04:55 +00:00
parent ef9a97a03a
commit 3159b9c0f5

View File

@ -38,6 +38,9 @@ class RedisQueue:
await subscriber.subscribe(["discord-api-req"]) await subscriber.subscribe(["discord-api-req"])
count = 0 count = 0
while True: while True:
if not self.bot.is_ready() or self.bot.is_closed():
await asyncio.sleep(0)
continue
reply = await subscriber.next_published() reply = await subscriber.next_published()
request = json.loads(reply.value) request = json.loads(reply.value)
resource = request["resource"] resource = request["resource"]