04/08 Refactored codes, fixed issues

This commit is contained in:
2026-04-08 16:12:33 -04:00
parent c5e6566b6d
commit 6e1c9bbc7d
11 changed files with 84 additions and 124 deletions
+11 -1
View File
@@ -33,6 +33,16 @@ class Config:
)
DEBUG = os.environ.get('DEBUG', 'False').lower() == 'true'
# ------------------------------------------------------------------ #
# SQLAlchemy connection pool (read from .env; safe defaults)
# ------------------------------------------------------------------ #
SQLALCHEMY_ENGINE_OPTIONS = {
'pool_size': int(os.environ.get('SQLALCHEMY_ENGINE_OPTIONS_POOL_SIZE', '10')),
'pool_timeout': int(os.environ.get('SQLALCHEMY_ENGINE_OPTIONS_POOL_TIMEOUT', '20')),
'pool_recycle': int(os.environ.get('SQLALCHEMY_ENGINE_OPTIONS_POOL_RECYCLE', '3600')),
'max_overflow': int(os.environ.get('SQLALCHEMY_ENGINE_OPTIONS_MAX_OVERFLOW', '20')),
}
# ------------------------------------------------------------------ #
# Session / cookies
# ------------------------------------------------------------------ #
@@ -107,4 +117,4 @@ _config_map = {
def get_config():
"""Return the active Config class based on FLASK_ENV."""
env = os.environ.get('FLASK_ENV', 'default').lower()
return _config_map.get(env, Config)
return _config_map.get(env, Config)