Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions scripts/verify-registry-release.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,19 @@ const run = (command, arguments_, options = {}) =>
});
const wait = (milliseconds) =>
new Promise((resolvePromise) => setTimeout(resolvePromise, milliseconds));
const registryLookupAttempts = 37;
const registryLookupIntervalMs = 5_000;

const readRegistryManifest = async () => {
let lastError;
for (let attempt = 1; attempt <= 12; attempt += 1) {
for (let attempt = 1; attempt <= registryLookupAttempts; attempt += 1) {
try {
return JSON.parse(run("npm", ["view", specification, "--json"]));
} catch (error) {
lastError = error;
if (attempt < 12) await wait(5_000);
if (attempt < registryLookupAttempts) {
await wait(registryLookupIntervalMs);
}
}
}
throw lastError;
Expand Down
Loading