Skip to content
This repository was archived by the owner on Oct 19, 2025. It is now read-only.

Reload connection pool when connection with Postgres is lost - #5

Open
cryptobioz wants to merge 2 commits into
addok:masterfrom
cryptobioz:reload-pool-connection-lost
Open

Reload connection pool when connection with Postgres is lost#5
cryptobioz wants to merge 2 commits into
addok:masterfrom
cryptobioz:reload-pool-connection-lost

Conversation

@cryptobioz

Copy link
Copy Markdown

As the connection pool is created during the initialization, when the connection to the PostgreSQL server is lost, Addok is not able to setup a new connection pool. Thus, you must restart Addok to get your service back.

This PR intends to fix this behavior by checking if the connection is lost every time you request a connection from the pool. If it's the case, it will create a new pool and pick a connection from it.

Comment thread addok_psql_store/__init__.py Outdated
@cryptobioz
cryptobioz force-pushed the reload-pool-connection-lost branch from 0d5164c to 03cdcf1 Compare February 3, 2020 19:01
Comment thread addok_psql_store/__init__.py Outdated
@cryptobioz
cryptobioz force-pushed the reload-pool-connection-lost branch 2 times, most recently from 3c2874b to 5a82265 Compare February 4, 2020 08:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants