chore: Custome http(s) request timeout support #366
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related: #365
背景描述
当我进行多文件上传时. 经常会因为 zone request timeout 导致上传错误.
通过查看源码发现. https://github.com/qiniu/nodejs-sdk/blob/master/qiniu/zone.js#L65 没有设置请求超时时间. 默认的话 urllib 的超时时间为
5000ms
. 当我在进行大量文件同时上传的时候, 由于带宽占用. 请求经常会超出5000ms
.所以需要可以支持 用户自定义请求超时时间. 可以增加一个环境变量之类的.
QINIU_NODESDK_REQUEST_MIN_TIMEOUT
.