use allSettled
This commit is contained in:
parent
83c15a77c3
commit
17fa584ea1
5 changed files with 15 additions and 22 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue