On 04-09-2014 06:25, lvroyce(a)linux.vnet.ibm.com wrote:
try:
+ size = 0
f = open(file_path, 'wb')
+ pool.refresh()
while True:
data = upload_file.file.read(8192)
if not data:
break
+ size += len(data)
f.write(data)
+ cb('%s/%s' % (f_len, size), True)
f.close()
Is there any specific reason the method "pool.refresh()" is called from
inside the loop? I mean, is it necessary for the upload operation /
partial data retrieval? If not, I'd suggest to keep that command outside
the loop (as it is now). That loop will run for many iterations (e.g. ~
90,000 for a 700 MB ISO file), so the less we execute inside that loop,
the better.