From 6049e5ef5ce435b5df8763faf96d1d67ae2e826f Mon Sep 17 00:00:00 2001 From: zcemycl Date: Tue, 7 Nov 2023 00:39:22 +0000 Subject: [PATCH] try fixing --- Dockerfile.pgvector | 2 +- tests/conftest.py | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Dockerfile.pgvector b/Dockerfile.pgvector index 88283b0..0ac3d18 100644 --- a/Dockerfile.pgvector +++ b/Dockerfile.pgvector @@ -11,7 +11,7 @@ RUN make install FROM postgres:14.4-alpine COPY ./src/sql/init.sql /docker-entrypoint-initdb.d/ -COPY ./src/docker/postgres/postgresql.conf /var/lib/postgresql/data/ +# COPY ./src/docker/postgres/postgresql.conf /var/lib/postgresql/data/ COPY --from=pgvector-builder /usr/local/lib/postgresql/bitcode/vector.index.bc /usr/local/lib/postgresql/bitcode/vector.index.bc COPY --from=pgvector-builder /usr/local/lib/postgresql/vector.so /usr/local/lib/postgresql/vector.so COPY --from=pgvector-builder /usr/local/share/postgresql/extension /usr/local/share/postgresql/extension diff --git a/tests/conftest.py b/tests/conftest.py index a7586f9..c60a592 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -26,7 +26,16 @@ def event_loop() -> asyncio.AbstractEventLoop: @pytest.fixture(autouse=True) def get_engine_orm() -> AsyncEngine: db_url = "postgresql+asyncpg://postgres:postgres@localhost/postgres" - engine = create_async_engine(db_url) + engine = create_async_engine( + db_url, + connect_args={ + "server_settings": { + "tcp_keepalives_idle": "600", + "tcp_keepalives_interval": "30", + "tcp_keepalives_count": "10", + } + }, + ) yield engine engine.sync_engine.dispose()