qiniu / nodejs-sdk

Qiniu Resource (Cloud) Storage SDK for Node.js
589 stars 190 forks source link

chore: Custome http(s) request timeout support #366

Open alberthuang24 opened 4 years ago

alberthuang24 commented 4 years ago

Related: #365

背景描述

image 当我进行多文件上传时. 经常会因为 zone request timeout 导致上传错误.

通过查看源码发现. https://github.com/qiniu/nodejs-sdk/blob/master/qiniu/zone.js#L65 没有设置请求超时时间. 默认的话 urllib 的超时时间为 5000ms. 当我在进行大量文件同时上传的时候, 由于带宽占用. 请求经常会超出 5000ms.

所以需要可以支持 用户自定义请求超时时间. 可以增加一个环境变量之类的. QINIU_NODESDK_REQUEST_MIN_TIMEOUT.

qiniu-bot commented 4 years ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: HongjiangHuang To complete the pull request process, please assign You can assign the PR to them by writing /assign in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files: - **[OWNERS](https://github.com/qiniu/nodejs-sdk/blob/master/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
alberthuang24 commented 4 years ago

/assign bachue