mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-06-20 03:56:38 +00:00
Use the correct clock time when sleeping on iter_messages
This commit is contained in:
parent
509fba8bcc
commit
cbd5594dba
@ -1,7 +1,6 @@
|
|||||||
import asyncio
|
import asyncio
|
||||||
import itertools
|
import itertools
|
||||||
import logging
|
import logging
|
||||||
import time
|
|
||||||
import warnings
|
import warnings
|
||||||
from collections import UserList
|
from collections import UserList
|
||||||
|
|
||||||
@ -217,8 +216,9 @@ class MessageMethods(UploadMethods, MessageParseMethods):
|
|||||||
else:
|
else:
|
||||||
request.max_date = r.messages[-1].date
|
request.max_date = r.messages[-1].date
|
||||||
|
|
||||||
|
now = asyncio.get_event_loop().time()
|
||||||
await asyncio.sleep(
|
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):
|
async def get_messages(self, *args, **kwargs):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user