Use larger chunks when downloading/uploading files

This commit is contained in:
Lonami Exo 2017-10-09 13:19:03 +02:00
parent a7622324dd
commit e2ac18b7bc

View File

@ -378,11 +378,7 @@ def find_user_or_chat(peer, users, chats):
def get_appropriated_part_size(file_size): def get_appropriated_part_size(file_size):
"""Gets the appropriated part size when uploading or downloading files, """Gets the appropriated part size when uploading or downloading files,
given an initial file size""" given an initial file size"""
if file_size <= 1048576: # 1MB if file_size <= 104857600: # 100MB
return 32
if file_size <= 10485760: # 10MB
return 64
if file_size <= 393216000: # 375MB
return 128 return 128
if file_size <= 786432000: # 750MB if file_size <= 786432000: # 750MB
return 256 return 256