Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(node): uncatchable exception if request failed in queue #1892

Merged
merged 1 commit into from
Sep 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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