From 0608fa3cab27d8ceaf18976d6fb128b9550fb989 Mon Sep 17 00:00:00 2001 From: Juerg B <44573692+juergba@users.noreply.github.com> Date: Tue, 29 Mar 2022 09:41:22 +0200 Subject: [PATCH] chore(site): fix supporters' download (#4859) --- docs/_data/supporters.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/_data/supporters.js b/docs/_data/supporters.js index 6fcd4011a8..d31bebd524 100755 --- a/docs/_data/supporters.js +++ b/docs/_data/supporters.js @@ -52,7 +52,7 @@ const SPONSOR_TIER = 'sponsors'; const BACKER_TIER = 'backers'; // if this percent of fetches completes, the build will pass -const PRODUCTION_SUCCESS_THRESHOLD = 0.8; +const PRODUCTION_SUCCESS_THRESHOLD = 0.9; const SUPPORTER_IMAGE_PATH = resolve(__dirname, '../images/supporters'); @@ -107,7 +107,7 @@ const fetchImage = process.env.MOCHA_DOCS_SKIP_IMAGE_DOWNLOAD try { const {avatar: url} = supporter; const {body: imageBuf, headers} = await needle('get', url, { - timeout: 2000 + open_timeout: 30000 }); if (headers['content-type'].startsWith('text/html')) { throw new TypeError( @@ -247,16 +247,16 @@ const getSupporters = async () => { const backerCount = supporters[BACKER_TIER].length; const sponsorCount = supporters[SPONSOR_TIER].length; - const totalValidSupportersCount = backerCount + sponsorCount; - const successRate = totalValidSupportersCount / invalidSupporters.length; + const totalSupportersCount = backerCount + sponsorCount; + const successRate = 1 - invalidSupporters.length / totalSupportersCount; debug( 'found %d valid backers and %d valid sponsors (%d total; %d invalid; %d blocked)', backerCount, sponsorCount, - totalValidSupportersCount, + totalSupportersCount, invalidSupporters.length, - uniqueSupporters.size - totalValidSupportersCount + uniqueSupporters.size - totalSupportersCount ); if (successRate < PRODUCTION_SUCCESS_THRESHOLD) {