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

Fixed #36 #1

Closed
wants to merge 1 commit into from
Closed

Fixed #36 #1

wants to merge 1 commit into from

Conversation

philippeauriach
Copy link
Owner

@philippeauriach philippeauriach commented Sep 13, 2017

Currently, a pg pool was created for each request : this is bad, as each pool keeps a connection to the db so it can reuse it. This caused issue faradayio#36 for me.
By following the example here : https://github.com/brianc/node-postgres/tree/v6.4.1 the pool must be created only once, and reused across requests (that's the purpose of a pool).

For info, this probably origined after the changes made to the pg lib, which switched from a singleton to a pg Pool instance when updating to v6.x

Currently, a pg pool was created for each request : this is bad, as each pool keeps a connection to the db so it can reuse it. This caused issue faradayio#36 for me. 
By following the example here : https://github.com/brianc/node-postgres/tree/v6.4.1 the pool must be created only once, and reused across requests (that's the purpose of a pool).
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