fix: avoid potential queuing dead lock
This commit is contained in:
parent
bc9c41f005
commit
16e1aab1c2
1 changed files with 2 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue