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

Axios provider which makes res.resume() after every unsuccessful request #42

Merged
merged 3 commits into from
Jul 10, 2022

Conversation

shedy2
Copy link
Contributor

@shedy2 shedy2 commented Jul 8, 2022

It's an experimental feature based on nodejs/node#37068 trying to avoid http module memory leak.
The example of usage from docs:
image

@shedy2
Copy link
Contributor Author

shedy2 commented Jul 8, 2022

the file src/lib/http/axiosResumeHttpAdapter.js - is an overrided copy from axios/lib/adapters/http.js with redefined imports and new 4 lines of code:

 if (res.statusCode !== 200) {
        console.log('Experimental feature: res.statusCode !== 200 -> res.resume()');
        res.resume();
      }

Looks like there is no way to override this behavior other than creating a new provider file.

Copy link
Contributor

@netlob netlob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just tested and works too

Ill deploy it to the beta infra now :)

@netlob netlob merged commit f57b506 into main Jul 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants