File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed
cads_processing_api_service Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -197,6 +197,11 @@ def profiles_api_url(self) -> str:
197
197
missing_licences_message : str = MISSING_LICENCES_MESSAGE
198
198
dataset_licences_url : str = DATASET_LICENCES_URL
199
199
200
+ retrieve_api_broker_pool_timeout : float = 1.0
201
+ retrieve_api_broker_pool_recycle : int = 60
202
+ retrieve_api_broker_pool_size : int = 5
203
+ retrieve_api_broker_max_overflow : int = 15
204
+
200
205
rate_limits_file : str | None = None
201
206
rate_limits : RateLimitsConfig = pydantic .Field (default = RateLimitsConfig ())
202
207
Original file line number Diff line number Diff line change 22
22
import sqlalchemy
23
23
import sqlalchemy .orm
24
24
25
+ from . import config
26
+
27
+ SETTINGS = config .settings
28
+
25
29
26
30
class ConnectionMode (str , enum .Enum ):
27
31
"""Database connection mode."""
@@ -56,10 +60,10 @@ def get_compute_sessionmaker(
56
60
raise ValueError (f"Invalid connection mode: { str (mode )} " )
57
61
broker_engine = sqlalchemy .create_engine (
58
62
connection_string ,
59
- pool_timeout = broker_settings . broker_pool_timeout ,
60
- pool_recycle = broker_settings . broker_pool_recycle ,
61
- pool_size = broker_settings . broker_pool_size ,
62
- max_overflow = broker_settings . broker_max_overflow ,
63
+ pool_timeout = SETTINGS . retrieve_api_broker_pool_timeout ,
64
+ pool_recycle = SETTINGS . retrieve_api_broker_pool_recycle ,
65
+ pool_size = SETTINGS . retrieve_api_broker_pool_size ,
66
+ max_overflow = SETTINGS . retrieve_api_broker_max_overflow ,
63
67
)
64
68
return sqlalchemy .orm .sessionmaker (broker_engine )
65
69
You can’t perform that action at this time.
0 commit comments