ignore cited papers with no authors
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 40s
Details
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 40s
Details
This commit is contained in:
parent
6a644097fe
commit
b1b59e6df5
|
@ -146,19 +146,23 @@ const importPaper = async (paper) => {
|
|||
const { paperId } = paper;
|
||||
const references = paper.references.filter((x) => !!x.paperId);
|
||||
const eachCitationWeightPercent = Math.floor(PPM_TO_CITATIONS / references.length);
|
||||
const citations = await Promise.mapSeries(
|
||||
const citations = (await Promise.mapSeries(
|
||||
references,
|
||||
async (citedPaper) => {
|
||||
// We need to fetch this paper so we can generate the post we WOULD add to the forum.
|
||||
// That way, if we later add the cited paper to the blockchain it will have the correct hash.
|
||||
// The forum allows dangling citations to support this use case.
|
||||
const citedPost = await generatePost(citedPaper);
|
||||
return {
|
||||
weightPPM: eachCitationWeightPercent,
|
||||
targetPostId: citedPost.hash,
|
||||
};
|
||||
try {
|
||||
const citedPost = await generatePost(citedPaper);
|
||||
return {
|
||||
weightPPM: eachCitationWeightPercent,
|
||||
targetPostId: citedPost.hash,
|
||||
};
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
);
|
||||
)).filter((x) => !!x);
|
||||
|
||||
// Make sure citation weights sum to the designated total
|
||||
if (citations.length) {
|
||||
|
|
Loading…
Reference in New Issue