From cb741f0c1da2ce1d65a72120c20f99210da76aab Mon Sep 17 00:00:00 2001 From: lowlighter <22963968+lowlighter@users.noreply.github.com> Date: Thu, 12 Aug 2021 13:33:31 +0200 Subject: [PATCH] Lines plugin: ignore repositories that could not be fetched correctly [skip ci] --- source/plugins/lines/index.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/plugins/lines/index.mjs b/source/plugins/lines/index.mjs index d92962b5e28..9c3e089214b 100644 --- a/source/plugins/lines/index.mjs +++ b/source/plugins/lines/index.mjs @@ -23,7 +23,8 @@ export default async function({login, data, imports, rest, q, account}, {enabled //Get contributors stats from repositories console.debug(`metrics/compute/${login}/plugins > lines > querying api`) const lines = {added:0, deleted:0} - const response = await Promise.all(repositories.map(({repo, owner}) => (skipped.includes(repo.toLocaleLowerCase())) || (skipped.includes(`${owner}/${repo}`)) ? {} : rest.repos.getContributorsStats({owner, repo}))) + const response = [...await Promise.allSettled(repositories.map(({repo, owner}) => (skipped.includes(repo.toLocaleLowerCase())) || (skipped.includes(`${owner}/${repo}`)) ? {} : rest.repos.getContributorsStats({owner, repo})))].filter(({status}) => status === "fulfilled").map(({value}) => value) + //Compute changed lines console.debug(`metrics/compute/${login}/plugins > lines > computing total diff`) response.map(({data:repository}) => {