Use the correct clock time when sleeping on iter_messages

This commit is contained in:
Lonami Exo 2018-06-15 17:09:16 +02:00
parent 509fba8bcc
commit cbd5594dba

View File

@ -1,7 +1,6 @@
import asyncio
import itertools
import logging
import time
import warnings
from collections import UserList
@ -217,8 +216,9 @@ class MessageMethods(UploadMethods, MessageParseMethods):
else:
request.max_date = r.messages[-1].date
now = asyncio.get_event_loop().time()
await asyncio.sleep(
max(wait_time - (time.time() - start), 0), loop=self._loop)
max(wait_time - (now - start), 0), loop=self._loop)
async def get_messages(self, *args, **kwargs):
"""