use allSettled

This commit is contained in:
Andras Schmelczer 2025-11-23 15:09:35 +00:00
parent 83c15a77c3
commit 17fa584ea1
5 changed files with 15 additions and 22 deletions

View file

@ -54,7 +54,9 @@ export class Locks<T> {
const uniqueKeys = Array.from(new Set(keys));
uniqueKeys.sort((a, b) => String(a).localeCompare(String(b))); // Ensure consistent order to prevent deadlocks
await Promise.all(uniqueKeys.map(async (key) => this.waitForLock(key)));
await Promise.allSettled(
uniqueKeys.map(async (key) => this.waitForLock(key))
);
try {
return await fn();