Retry downloading the malware database 3 times

This commit is contained in:
Sander Declerck 2026-01-14 14:02:27 +01:00
parent 7377b5577a
commit 14e94dcb62
No known key found for this signature in database
2 changed files with 77 additions and 34 deletions

View file

@ -48,13 +48,13 @@ export async function openMalwareDatabase() {
*/
function getPackageStatus(name, version) {
const normalizedName = normalizePackageName(name);
const packageData = malwareDatabase.find(
(pkg) => {
const normalizedPkgName = normalizePackageName(pkg.package_name);
return normalizedPkgName === normalizedName &&
(pkg.version === version || pkg.version === "*");
}
);
const packageData = malwareDatabase.find((pkg) => {
const normalizedPkgName = normalizePackageName(pkg.package_name);
return (
normalizedPkgName === normalizedName &&
(pkg.version === version || pkg.version === "*")
);
});
if (!packageData) {
return MALWARE_STATUS_OK;