next_delay fix conversion

This commit is contained in:
andrew (from workstation) 2019-11-05 19:56:24 +01:00
parent eaba19a078
commit eda2512f0f

View File

@ -17,7 +17,13 @@ class MtProtoTask(AsyncTask, abc.ABC):
async def _process(self) -> typing.Union[bool, int]: async def _process(self) -> typing.Union[bool, int]:
try: try:
return await self.process() * 1e9
result = await self.process()
if result is False:
return False
return result * 1e9
except FloodWait as error: except FloodWait as error:
return int(error.MESSAGE.split("_")[-1]) * 1e9 return int(error.MESSAGE.split("_")[-1]) * 1e9