Skip to content

Commit

Permalink
fix(node): uncatchable exception if request failed in queue
Browse files Browse the repository at this point in the history
  • Loading branch information
davidyuk committed Aug 27, 2023
1 parent b1f4883 commit dec62a4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils/autorest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ export const genRequestQueuesPolicy = (): AdditionalPolicyConfig => {
request.headers.delete('__queue');
const getResponse = async (): Promise<PipelineResponse> => next(request);
if (key == null) return getResponse();
const req = (requestQueues.get(key) ?? Promise.resolve()).then(getResponse, getResponse);
// TODO: remove after fixing https://github.com/aeternity/aeternity/issues/3803
const req = (requestQueues.get(key) ?? Promise.resolve()).then(getResponse);
// TODO: remove pause after fixing https://github.com/aeternity/aeternity/issues/3803
// gap to ensure that node won't reject the nonce
requestQueues.set(key, req.then(async () => pause(750)));
requestQueues.set(key, req.then(async () => pause(750), () => {}));
return req;
},
},
Expand Down

0 comments on commit dec62a4

Please sign in to comment.