diff --git a/src/fides/api/tasks/__init__.py b/src/fides/api/tasks/__init__.py index e757052ac1..ed5d9b8556 100644 --- a/src/fides/api/tasks/__init__.py +++ b/src/fides/api/tasks/__init__.py @@ -64,10 +64,11 @@ def get_new_session(self) -> ContextManager[Session]: if self._task_engine is None: self._task_engine = get_db_engine( config=CONFIG, + pool_size=CONFIG.database.task_engine_pool_size, + max_overflow=CONFIG.database.task_engine_max_overflow, keepalives_idle=CONFIG.database.task_engine_keepalives_idle, keepalives_interval=CONFIG.database.task_engine_keepalives_interval, keepalives_count=CONFIG.database.task_engine_keepalives_count, - disable_pooling=True, ) # same for the sessionmaker diff --git a/tests/ops/tasks/test_database_task.py b/tests/ops/tasks/test_database_task.py index 0076f16f84..c2907ade17 100644 --- a/tests/ops/tasks/test_database_task.py +++ b/tests/ops/tasks/test_database_task.py @@ -42,21 +42,6 @@ def always_failing_session_maker(self): mock_maker.side_effect = OperationalError("connection failed", None, None) return mock_maker - @pytest.mark.parametrize( - "config_fixture", [None, "mock_config_changed_db_engine_settings"] - ) - def test_get_task_session(self, config_fixture, request): - if config_fixture is not None: - request.getfixturevalue( - config_fixture - ) # used to invoke config fixture if provided - pool_size = CONFIG.database.task_engine_pool_size - max_overflow = CONFIG.database.task_engine_max_overflow - t = DatabaseTask() - session: Session = t.get_new_session() - engine: Engine = session.get_bind() - assert isinstance(engine.pool, NullPool) - def test_retry_on_operational_error(self, recovering_session_maker): """Test that session creation retries on OperationalError"""