We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e47ca86 commit 9e57796Copy full SHA for 9e57796
src/server/_config.py
@@ -11,7 +11,16 @@
11
MAX_COMPATIBILITY_RESULTS = int(3650)
12
13
SQLALCHEMY_DATABASE_URI = os.environ.get("SQLALCHEMY_DATABASE_URI", "sqlite:///test.db")
14
-SQLALCHEMY_ENGINE_OPTIONS = json.loads(os.environ.get("SQLALCHEMY_ENGINE_OPTIONS", "{}"))
+
15
+# defaults
16
+SQLALCHEMY_ENGINE_OPTIONS = {
17
+ "pool_pre_ping": True, # enable ping test for validity of recycled pool connections on connect() calls
18
+ "pool_recycle": 5 # seconds after which a recycled pool connection is considered invalid
19
+}
20
+# update with overrides of defaults or additions from external configs
21
+SQLALCHEMY_ENGINE_OPTIONS.update(
22
+ json.loads(os.environ.get("SQLALCHEMY_ENGINE_OPTIONS", "{}")))
23
24
SECRET = os.environ.get("FLASK_SECRET", "secret")
25
URL_PREFIX = os.environ.get("FLASK_PREFIX", "/")
26
0 commit comments