Swallow and log errors

This commit is contained in:
Peter Hedenskog 2025-03-07 15:32:24 +01:00
parent 351ba66989
commit be2b9b5b13
1 changed files with 4 additions and 1 deletions

View File

@ -1,3 +1,6 @@
import { getLogger } from '@sitespeed.io/log';
const log = getLogger('sitespeedio.plugin.s3');
export async function runWithConcurrencyLimit(tasks, limit) {
async function worker() {
while (tasks.length > 0) {
@ -5,7 +8,7 @@ export async function runWithConcurrencyLimit(tasks, limit) {
try {
await task();
} catch (error) {
throw error;
log.error('Could not finish upload task', error);
}
}
}