Skip to content

Commit

Permalink
fix(ingester): update package data even if not present in the database (
Browse files Browse the repository at this point in the history
  • Loading branch information
m-maillot committed Feb 17, 2021
1 parent a33ac61 commit fa807d4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions targets/ingester/src/cli.js
Expand Up @@ -232,8 +232,13 @@ async function main() {
await download(pkgName, pkgInfo.url);
}
const ingestedVersion = await getLastIngestedVersion(pkgName);
// Need to update the package:
// if the version is lower than the version from database (ingestedVersion)
// or the package is not present in the database (ingestedVersion is null).
if (ingestedVersion && semver.gt(pkgInfo.version, ingestedVersion)) {
packagesToUpdate.set(pkgName, { getDocuments, version: pkgInfo.version });
} else if (!ingestedVersion) {
packagesToUpdate.set(pkgName, { getDocuments, version: pkgInfo.version });
}
}

Expand Down

0 comments on commit fa807d4

Please sign in to comment.