fix: update notifier should fail early (#3465)

close #3435
This commit is contained in:
Zoltan Kochan
2021-05-21 02:13:05 +03:00
committed by GitHub
parent 23adaf0c91
commit f45b1af7d4
3 changed files with 9 additions and 6 deletions

View File

@@ -0,0 +1,5 @@
---
"pnpm": patch
---
Do not retry requests, when checking for new versions of pnpm.

View File

@@ -32,13 +32,10 @@ export default async function (config: Config) {
...config,
authConfig: config.rawConfig,
retry: {
factor: config.fetchRetryFactor,
maxTimeout: config.fetchRetryMaxtimeout,
minTimeout: config.fetchRetryMintimeout,
retries: config.fetchRetries,
retries: 0,
},
storeDir,
timeout: config.fetchTimeout,
timeout: 3000,
})
const resolution = await resolve({ alias: packageManager.name, pref: 'latest' }, {
lockfileDir: config.lockfileDir ?? config.dir,

View File

@@ -202,7 +202,8 @@ export default async function run (inputArgv: string[]) {
// Don't check for updates
// 1. on CI environments
// 2. when in the middle of an actual update
if (!isCI && !selfUpdate) {
// 3. when the CLI is running in offline mode
if (!isCI && !selfUpdate && !config.offline && !config.preferOffline) {
checkForUpdates(config).catch(() => { /* Ignore */ })
}