avancement planning
This commit is contained in:
+5
-3
@@ -1,8 +1,9 @@
|
||||
const { Minipass } = require('minipass')
|
||||
const fetch = require('minipass-fetch')
|
||||
const promiseRetry = require('promise-retry')
|
||||
const { promiseRetry } = require('@gar/promise-retry')
|
||||
const ssri = require('ssri')
|
||||
const { log } = require('proc-log')
|
||||
const { redact: cleanUrl } = require('@npmcli/redact')
|
||||
|
||||
const CachingMinipassPipeline = require('./pipeline.js')
|
||||
const { getAgent } = require('@npmcli/agent')
|
||||
@@ -55,6 +56,7 @@ const remoteFetch = (request, options) => {
|
||||
|
||||
return promiseRetry(async (retryHandler, attemptNum) => {
|
||||
const req = new fetch.Request(request, _opts)
|
||||
const url = cleanUrl(req.url)
|
||||
try {
|
||||
let res = await fetch(req, _opts)
|
||||
if (_opts.integrity && res.status === 200) {
|
||||
@@ -92,7 +94,7 @@ const remoteFetch = (request, options) => {
|
||||
}
|
||||
|
||||
/* eslint-disable-next-line max-len */
|
||||
log.http('fetch', `${req.method} ${req.url} attempt ${attemptNum} failed with ${res.status}`)
|
||||
log.http('fetch', `${req.method} ${url} attempt ${attemptNum} failed with ${res.status}`)
|
||||
return retryHandler(res)
|
||||
}
|
||||
|
||||
@@ -116,7 +118,7 @@ const remoteFetch = (request, options) => {
|
||||
options.onRetry(err)
|
||||
}
|
||||
|
||||
log.http('fetch', `${req.method} ${req.url} attempt ${attemptNum} failed with ${err.code}`)
|
||||
log.http('fetch', `${req.method} ${url} attempt ${attemptNum} failed with ${err.code}`)
|
||||
return retryHandler(err)
|
||||
}
|
||||
}, options.retry).catch((err) => {
|
||||
|
||||
Reference in New Issue
Block a user