qiniu / qiniu/nodejs-sdk

[feature] 需要增加一个用户自定义的请求超时时间.

Open
#365 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
590
Forks
191
PR merge metrics
No merged PRs in 30d

Description

背景描述

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

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

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with qiniu/zone.js at the request setup around line 65, and trace how urllib receives its timeout configuration. Make the request timeout user-configurable, including the proposed QINIU_NODESDK_REQUEST_MIN_TIMEOUT environment variable, and verify that multi-file uploads are no longer limited by urllib’s fixed 5000ms default.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.