diff options
author | isaacs <i@izs.me> | 2020-09-28 21:16:40 +0300 |
---|---|---|
committer | nlf <quitlahok@gmail.com> | 2020-09-29 21:43:49 +0300 |
commit | 2469ae5153fa4114a72684376a1b226aa07edf81 (patch) | |
tree | 394ecaf2ec1fb087bc65fb68be128f8a99103cb6 /lib/utils | |
parent | e225ddcf8d74a6b1cfb24ec49e37e3f5d06e5151 (diff) |
Add 'fetch-timeout' config
This gets passed down to dependencies as 'timeout', so that the HTTP
request libraries will all get the right value.
Fix: https://github.com/npm/cli/issues/1780
PR-URL: https://github.com/npm/cli/pull/1870
Credit: @isaacs
Close: #1870
Reviewed-by: @nlf
Diffstat (limited to 'lib/utils')
-rw-r--r-- | lib/utils/config.js | 2 | ||||
-rw-r--r-- | lib/utils/flat-options.js | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/lib/utils/config.js b/lib/utils/config.js index 6dc0f75e4..5fe14a722 100644 --- a/lib/utils/config.js +++ b/lib/utils/config.js @@ -88,6 +88,7 @@ const defaults = { 'fetch-retry-factor': 10, 'fetch-retry-mintimeout': 10000, 'fetch-retry-maxtimeout': 60000, + 'fetch-timeout': 5 * 60 * 1000, git: 'git', 'git-tag-version': true, @@ -221,6 +222,7 @@ const types = { 'fetch-retry-factor': Number, 'fetch-retry-mintimeout': Number, 'fetch-retry-maxtimeout': Number, + 'fetch-timeout': Number, git: String, 'git-tag-version': Boolean, 'commit-hooks': Boolean, diff --git a/lib/utils/flat-options.js b/lib/utils/flat-options.js index d6decdbf7..54ba22d6c 100644 --- a/lib/utils/flat-options.js +++ b/lib/utils/flat-options.js @@ -147,6 +147,8 @@ const flatOptions = npm => npm.flatOptions || Object.freeze({ minTimeout: npm.config.get('fetch-retry-mintimeout') }, + timeout: npm.config.get('fetch-timeout'), + force: npm.config.get('force'), formatPackageLock: npm.config.get('format-package-lock'), |