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

close session if it won't be reused #138

Merged
merged 2 commits into from
Apr 5, 2020
Merged

Conversation

spyoungtech
Copy link
Owner

@spyoungtech spyoungtech commented Apr 3, 2020

As described in #137 grequests holds onto memory if the session is not closed. Other issues can also be caused by creating (and never closing) many session objects. Also relates to #115

This solution will close the session if a session object is not provided by the user. If the user does provide a session object, we don't close it, otherwise the user may lose some benefits of using a single session object and its connection pool. If a user provides a session object, it also addresses the memory build up, since we don't create a session in that case.

@spyoungtech spyoungtech merged commit 7307426 into master Apr 5, 2020
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.

1 participant