From 0c96fa8b7cd4a7f22bceacf12c85d5f68770db98 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Wed, 11 Jul 2018 17:05:33 +0200 Subject: [PATCH] Don't flush each chunk. Let python/os deal with it --- pyrogram/client/client.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index e8cc394f..709ea95a 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -1240,8 +1240,6 @@ class Client(Methods, BaseClient): break f.write(chunk) - f.flush() - os.fsync(f.fileno()) offset += limit @@ -1324,8 +1322,6 @@ class Client(Methods, BaseClient): assert h.hash == sha256(cdn_chunk).digest(), "Invalid CDN hash part {}".format(i) f.write(decrypted_chunk) - f.flush() - os.fsync(f.fileno()) offset += limit