Skip to content

Commit

Permalink
Merge pull request #1892 from aeternity/feature/fix-node-unhandled-error
Browse files Browse the repository at this point in the history
fix(node): uncatchable exception if request failed in queue
  • Loading branch information
davidyuk authored Sep 3, 2023
2 parents 24b179c + dec62a4 commit 3ad19b1
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 3ad19b1

Please sign in to comment.