diff --git a/src/renderer/managers/updater.ts b/src/renderer/managers/updater.ts index 5123c6b58..d2198e8d8 100644 --- a/src/renderer/managers/updater.ts +++ b/src/renderer/managers/updater.ts @@ -219,10 +219,25 @@ export async function checkAllUpdates(autoCheck = false, verbose = false): Promi logger.log("Checking for updates"); - await Promise.all([ - checkUpdate(REPLUGGED_ID, verbose), - ...addons.map((addon) => checkUpdate(addon.manifest.id, verbose)), - ]); + const delay = (ms: number): Promise => new Promise((resolve) => setTimeout(resolve, ms)); + + async function checkUpdatesWithRateLimit(): Promise { + await checkUpdate(REPLUGGED_ID, verbose); + + let addonCount = 0; + + for (const addon of addons) { + await checkUpdate(addon.manifest.id, verbose); + addonCount++; + + if (addonCount === 15) { + addonCount = 0; + await delay(1000); // Delay for 1 second after sending 15 requests + } + } + } + + await checkUpdatesWithRateLimit(); logger.log("All updates checked"); updaterSettings.set("lastChecked", Date.now());