Kaydet (Commit) 10f6d80f authored tarafından frknkrc44's avatar frknkrc44

Add configurable chunk size

üst 10e91f5a
......@@ -101,6 +101,9 @@ class GeneralDefaults:
# FETCHER USER-AGENT STRING
fetcher_useragent = 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)'
# FETCHER CHUNK SIZE
fetcher_chunksize = 8196
class BuildDefaults:
......
......@@ -278,7 +278,8 @@ class Fetcher:
else:
down = 0
total = int(total)
for data in c.iter_content(chunk_size=8196):
chunk = int(ctx.config.get_option('fetcher_chunksize') or 8196)
for data in c.iter_content(chunk_size=chunk):
self.file_id.write(data)
down += len(data)
self.handler.update(total, down)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment