Skip to content

Commit

Permalink
chore(site): fix supporters' download
Browse files Browse the repository at this point in the history
  • Loading branch information
juergba committed Mar 28, 2022
1 parent 785aeb1 commit 84ceffa
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/_data/supporters.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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 totalCount = backerCount + sponsorCount;
const successRate = (totalCount - invalidSupporters.length) / totalCount;

debug(
'found %d valid backers and %d valid sponsors (%d total; %d invalid; %d blocked)',
backerCount,
sponsorCount,
totalValidSupportersCount,
totalCount,
invalidSupporters.length,
uniqueSupporters.size - totalValidSupportersCount
uniqueSupporters.size - totalCount
);

if (successRate < PRODUCTION_SUCCESS_THRESHOLD) {
Expand Down

0 comments on commit 84ceffa

Please sign in to comment.