Increase shutil copy buffer length from 4KB to 512KB to improve network transfer performance.

This commit is contained in:
Brad Mann 2017-11-13 19:05:51 -05:00
commit f35efe725f

View file

@ -27,6 +27,11 @@ from core import logger, nzbToMediaDB
requests.packages.urllib3.disable_warnings()
# Monkey Patch shutil.copyfileobj() to adjust the buffer length to 512KB rather than 4KB
shutil.copyfileobjOrig = shutil.copyfileobj
def copyfileobjFast(fsrc, fdst, length=512*1024):
shutil.copyfileobjOrig(fsrc, fdst, length=length)
shutil.copyfileobj = copyfileobjFast
def reportNzb(failure_link, clientAgent):
# Contact indexer site