Parallelize extensions auto-update + add a toast

This commit is contained in:
Cohee 2023-11-22 00:58:06 +02:00
parent 59e558fba5
commit 4f7523b896
1 changed files with 4 additions and 1 deletions

View File

@ -846,12 +846,15 @@ async function checkForExtensionUpdates(force) {
} }
async function autoUpdateExtensions() { async function autoUpdateExtensions() {
toastr.info('Auto-updating extensions. This may take several minutes.', 'Please wait...', { timeOut: 10000, extendedTimeOut: 20000 });
const promises = [];
for (const [id, manifest] of Object.entries(manifests)) { for (const [id, manifest] of Object.entries(manifests)) {
if (manifest.auto_update && id.startsWith('third-party')) { if (manifest.auto_update && id.startsWith('third-party')) {
console.debug(`Auto-updating 3rd-party extension: ${manifest.display_name} (${id})`); console.debug(`Auto-updating 3rd-party extension: ${manifest.display_name} (${id})`);
await updateExtension(id.replace('third-party', ''), true); promises.push(updateExtension(id.replace('third-party', ''), true));
} }
} }
await Promise.allSettled(promises);
} }
/** /**