fix: avoid potential queuing dead lock

This commit is contained in:
WebStreamr 2025-06-09 20:37:53 +00:00
parent bc9c41f005
commit 16e1aab1c2
No known key found for this signature in database

View file

@ -253,9 +253,10 @@ export class Fetcher {
const queueErrorLimit = init?.queueErrorLimit ?? 10;
await this.lockFetchSlot(url.host, queueErrorLimit);
await this.waitForHostQueueCount(url.host, queueLimit, queueErrorLimit);
try {
await this.waitForHostQueueCount(url.host, queueLimit, queueErrorLimit);
return await this.fetchWithTimeout(ctx, url, init);
} finally {
await this.unlockFetchSlot(url.host);