mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-07 15:34:52 +00:00
Fix progress callbacks in asyncio
This commit is contained in:
parent
976eae63ed
commit
6292fe8f86
1 changed files with 3 additions and 3 deletions
|
|
@ -1202,7 +1202,7 @@ class Client(Methods, BaseClient):
|
||||||
file_part += 1
|
file_part += 1
|
||||||
|
|
||||||
if progress:
|
if progress:
|
||||||
progress(self, min(file_part * part_size, file_size), file_size, *progress_args)
|
await progress(self, min(file_part * part_size, file_size), file_size, *progress_args)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.error(e, exc_info=True)
|
log.error(e, exc_info=True)
|
||||||
else:
|
else:
|
||||||
|
|
@ -1321,7 +1321,7 @@ class Client(Methods, BaseClient):
|
||||||
offset += limit
|
offset += limit
|
||||||
|
|
||||||
if progress:
|
if progress:
|
||||||
progress(self, min(offset, size) if size != 0 else offset, size, *progress_args)
|
await progress(self, min(offset, size) if size != 0 else offset, size, *progress_args)
|
||||||
|
|
||||||
r = await session.send(
|
r = await session.send(
|
||||||
functions.upload.GetFile(
|
functions.upload.GetFile(
|
||||||
|
|
@ -1403,7 +1403,7 @@ class Client(Methods, BaseClient):
|
||||||
offset += limit
|
offset += limit
|
||||||
|
|
||||||
if progress:
|
if progress:
|
||||||
progress(self, min(offset, size) if size != 0 else offset, size, *progress_args)
|
await progress(self, min(offset, size) if size != 0 else offset, size, *progress_args)
|
||||||
|
|
||||||
if len(chunk) < limit:
|
if len(chunk) < limit:
|
||||||
break
|
break
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue