anderson-ufrj commited on
Commit
584cac1
·
1 Parent(s): 82988f1

fix(database): filter out pool-specific parameters when using NullPool

Browse files

- NullPool doesn't support pool_size, max_overflow, pool_timeout, pool_use_lifo
- Filter out these parameters to avoid TypeError on engine creation
- Keeps other configuration parameters like pool_recycle and pool_pre_ping

src/services/connection_pool_service.py CHANGED
@@ -163,11 +163,17 @@ class ConnectionPoolService:
163
  ) -> AsyncEngine:
164
  """Create database connection pool."""
165
  try:
 
 
 
 
 
 
166
  # Create engine with async-compatible pool
167
  engine = create_async_engine(
168
  url,
169
  poolclass=NullPool,
170
- **config
171
  )
172
 
173
  # Initialize stats
 
163
  ) -> AsyncEngine:
164
  """Create database connection pool."""
165
  try:
166
+ # Filter out pool-specific config when using NullPool
167
+ nullpool_config = {
168
+ k: v for k, v in config.items()
169
+ if k not in ['pool_size', 'max_overflow', 'pool_timeout', 'pool_use_lifo']
170
+ }
171
+
172
  # Create engine with async-compatible pool
173
  engine = create_async_engine(
174
  url,
175
  poolclass=NullPool,
176
+ **nullpool_config
177
  )
178
 
179
  # Initialize stats