Skip to content

Commit 0d56407

Browse files
authored
Merge pull request #63 from Basekick-Labs/release/25.11.2
fix: Correct fresh connection creation in pool cleanup
2 parents a024281 + 197195c commit 0d56407

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

api/duckdb_pool_simple.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,17 @@ def get_connection(self, timeout: float = 5.0):
171171
pass
172172

173173
# Create and return a fresh connection to the pool
174-
fresh_conn = duckdb.connect(self.db_path)
174+
fresh_conn = duckdb.connect()
175+
176+
# Apply configuration if provided
177+
if self.configure_fn:
178+
try:
179+
self.configure_fn(fresh_conn)
180+
except Exception as config_error:
181+
logger.error(f"Failed to configure fresh connection: {config_error}")
182+
fresh_conn.close()
183+
raise
184+
175185
self.pool.put(fresh_conn)
176186

177187
def get_metrics(self) -> Dict[str, Any]:

0 commit comments

Comments
 (0)