enable connection pools for sqlite

Connecting is reasonably expensive because the spatialite extension
needs to be loaded. Disable pooling for tests because there is some
memory leak when quickly opening and closing QueuePools with sqlite
connections.
This commit is contained in:
Sarah Hoffmann
2023-12-05 12:22:00 +01:00
parent c4fd3ab97f
commit 1b7c8240ba
2 changed files with 27 additions and 18 deletions

View File

@@ -198,7 +198,8 @@ def frontend(request, event_loop, tmp_path):
db, options))
return napi.NominatimAPI(Path('/invalid'),
{'NOMINATIM_DATABASE_DSN': f"sqlite:dbname={db}",
'NOMINATIM_USE_US_TIGER_DATA': 'yes'})
'NOMINATIM_USE_US_TIGER_DATA': 'yes',
'NOMINATIM_API_POOL_SIZE': '0'})
elif request.param == 'postgres_db':
def mkapi(apiobj, options=None):
return apiobj.api