diff --git a/lib/datasource/npm/get.js b/lib/datasource/npm/get.js index 426c9b6dda19787150a41acc0571936fe8c85546..c2de3834862b5868b025556141dbd8382d161eca 100644 --- a/lib/datasource/npm/get.js +++ b/lib/datasource/npm/get.js @@ -102,6 +102,8 @@ async function getDependency(name) { 'EAI_AGAIN', ], }, + // TODO: Move to configurable host rules + timeout: 60 * 1000, headers, }); const res = raw.body; diff --git a/lib/manager/bazel/update.js b/lib/manager/bazel/update.js index 04977c91684c535efeca5879e6471396eb23260c..28093dc779e0166febdc051a4ad4b8311b397c6e 100644 --- a/lib/manager/bazel/update.js +++ b/lib/manager/bazel/update.js @@ -35,7 +35,11 @@ async function updateDependency(fileContent, upgrade) { newUrl = `https://github.com/${upgrade.repo}/releases/download/${ upgrade.newValue }/${shortRepo}-${upgrade.newValue}.tar.gz`; - file = (await got(newUrl, { encoding: null })).body; + file = (await got(newUrl, { + encoding: null, + // TODO: Move to configurable host rules, or use utils/got + timeout: 60 * 1000, + })).body; } catch (err) { logger.debug( 'Failed to download release download - trying archive instead' diff --git a/lib/manager/gradle-wrapper/update.js b/lib/manager/gradle-wrapper/update.js index 491f39fc33151db0893bc4c6caa87179daf27b1d..77a42696ebea91d1014b828570c306b3e0222c21 100644 --- a/lib/manager/gradle-wrapper/update.js +++ b/lib/manager/gradle-wrapper/update.js @@ -38,7 +38,10 @@ function replaceType(url) { async function getChecksum(url) { try { - const response = await got(url, {}); + const response = await got(url, { + // TODO: Move to configurable host rules, or use utils/got + timeout: 60 * 1000, + }); return response.body; } catch (err) { if (err.statusCode === 404 || err.code === 'ENOTFOUND') { diff --git a/lib/manager/homebrew/update.js b/lib/manager/homebrew/update.js index 201823405ea6bea8d36bf78512eec673c827be8d..b5519e6e765cbf09e8e6add7bcf1a8e6b59c4d8f 100644 --- a/lib/manager/homebrew/update.js +++ b/lib/manager/homebrew/update.js @@ -34,7 +34,11 @@ async function updateDependency(content, upgrade) { }/releases/download/${upgrade.newValue}/${upgrade.repoName}-${coerce( upgrade.newValue )}.tar.gz`; - file = (await got(newUrl, { encoding: null })).body; + file = (await got(newUrl, { + encoding: null, + // TODO: Move to configurable host rules, or use utils/got + timeout: 60 * 1000, + })).body; } catch (errOuter) { logger.debug( `Failed to download release download for ${ diff --git a/lib/platform/bitbucket-server/bb-got-wrapper.js b/lib/platform/bitbucket-server/bb-got-wrapper.js index 9c6456fe150a1539c329f2aa9bc87689bb156457..5aa97dcc6095b23a1491d716f5e6c25b5d05f5dd 100644 --- a/lib/platform/bitbucket-server/bb-got-wrapper.js +++ b/lib/platform/bitbucket-server/bb-got-wrapper.js @@ -9,6 +9,8 @@ const platform = 'bitbucket-server'; async function get(path, options) { const { host } = URL.parse(path); const opts = { + // TODO: Move to configurable host rules, or use utils/got + timeout: 60 * 1000, json: true, basic: false, ...hostRules.find({ platform, host }), diff --git a/lib/platform/bitbucket/bb-got-wrapper.js b/lib/platform/bitbucket/bb-got-wrapper.js index 901e52e9fa0902003bcd3d604ad1663293917d3f..8197f9282270a787ec524724612791646783c684 100644 --- a/lib/platform/bitbucket/bb-got-wrapper.js +++ b/lib/platform/bitbucket/bb-got-wrapper.js @@ -7,6 +7,8 @@ let cache = {}; async function get(path, options) { const { host } = URL.parse(path); const opts = { + // TODO: Move to configurable host rules, or use utils/got + timeout: 60 * 1000, json: true, basic: false, ...hostRules.find({ platform: 'bitbucket', host }), diff --git a/lib/platform/github/gh-got-wrapper.js b/lib/platform/github/gh-got-wrapper.js index 60ba586c97acf651245cecef380afb8821df1921..50222697834ec9ed928eff78ad0a0bc475f03984 100644 --- a/lib/platform/github/gh-got-wrapper.js +++ b/lib/platform/github/gh-got-wrapper.js @@ -13,6 +13,8 @@ let stats = {}; async function get(path, options, retries = 5) { const { host } = URL.parse(path); const opts = { + // TODO: Move to configurable host rules, or use utils/got + timeout: 60 * 1000, ...hostRules.find({ platform: 'github', host }), ...options, }; diff --git a/lib/platform/gitlab/gl-got-wrapper.js b/lib/platform/gitlab/gl-got-wrapper.js index b94465521b8c1f3c728cf89be0805de8b0a6a8d8..c6d159639dbde2e7bb57479775be0fd997abe91e 100644 --- a/lib/platform/gitlab/gl-got-wrapper.js +++ b/lib/platform/gitlab/gl-got-wrapper.js @@ -10,6 +10,8 @@ let cache = {}; async function get(path, options, retries = 5) { const { host } = URL.parse(path); const opts = { + // TODO: Move to configurable host rules, or use utils/got + timeout: 60 * 1000, ...hostRules.find({ platform: 'gitlab', host }), ...options, }; diff --git a/lib/util/got/host-rules.js b/lib/util/got/host-rules.js index e9c1520412bc6f75f8750fa0ac0670447112a787..0586916e70957c9b25e05c8abe3b47255b4988b8 100644 --- a/lib/util/got/host-rules.js +++ b/lib/util/got/host-rules.js @@ -5,7 +5,10 @@ const hostRules = require('../host-rules'); // istanbul ignore next module.exports = got.create({ - options: {}, + options: { + // TODO: Move to configurable host rules + timeout: 60 * 1000, + }, handler: (options, next) => { const { platform, ...opts } = options; if (!options.hostname) {