sort of a fix

This commit is contained in:
Frisk 2020-09-13 01:57:37 +02:00
parent 75a865287f
commit 97b2fe1880
No known key found for this signature in database
GPG key ID: 213F7C15068AF8AC

View file

@ -46,7 +46,11 @@ class MessageQueue:
status = await send_to_discord_webhook(msg, webhook_url) status = await send_to_discord_webhook(msg, webhook_url)
if status[0] < 2: if status[0] < 2:
logger.debug("Sending message succeeded") logger.debug("Sending message succeeded")
try:
self._queue.remove(msg) self._queue.remove(msg)
except ValueError:
# For the love of god I cannot figure why can it return ValueError: list.remove(x): x not in list, however considering it's not in the list, somehow, anymore we can just not care about it I guess
pass
logger.debug("Current rate limit time: {}".format(status[1])) logger.debug("Current rate limit time: {}".format(status[1]))
if status[1] is not None: if status[1] is not None:
await asyncio.sleep(float(status[1])) # note, the timer on the last request won't matter that much since it's separate task and for the time of sleep it will give control to other tasks await asyncio.sleep(float(status[1])) # note, the timer on the last request won't matter that much since it's separate task and for the time of sleep it will give control to other tasks