Merge pull request #657 from bugout-dev/add-pre-ping

Add pool pre ping parameter.
pull/658/head moonstreamdb/v0.3.2
Andrey Dolgolev 2022-08-25 20:18:35 +03:00 zatwierdzone przez GitHub
commit 4ac5b9e716
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 5 dodań i 2 usunięć

Wyświetl plik

@ -39,11 +39,14 @@ except:
)
def create_moonstream_engine(url: str, pool_size: int, statement_timeout: int):
def create_moonstream_engine(
url: str, pool_size: int, statement_timeout: int, pool_pre_ping: bool = False
):
# Pooling: https://docs.sqlalchemy.org/en/14/core/pooling.html#sqlalchemy.pool.QueuePool
# Statement timeout: https://stackoverflow.com/a/44936982
return create_engine(
url=url,
pool_pre_ping=pool_pre_ping,
pool_size=pool_size,
connect_args={"options": f"-c statement_timeout={statement_timeout}"},
)

Wyświetl plik

@ -2,4 +2,4 @@
Moonstream database version.
"""
MOONSTREAMDB_VERSION = "0.3.1"
MOONSTREAMDB_VERSION = "0.3.2"