db pool config options

This commit is contained in:
rimu 2025-01-20 13:47:10 +13:00
parent df450acd3d
commit 01d82939e0
2 changed files with 4 additions and 1 deletions

View file

@ -32,7 +32,7 @@ def get_locale():
return 'en' return 'en'
db = SQLAlchemy(session_options={"autoflush": False}) # engine_options={'pool_size': 5, 'max_overflow': 10} # session_options={"autoflush": False} db = SQLAlchemy(session_options={"autoflush": False}, engine_options={'pool_size': Config.DB_POOL_SIZE, 'max_overflow': Config.DB_MAX_OVERFLOW}) # engine_options={'pool_size': 5, 'max_overflow': 10} # session_options={"autoflush": False}
migrate = Migrate() migrate = Migrate()
login = LoginManager() login = LoginManager()
login.login_view = 'auth.login' login.login_view = 'auth.login'

View file

@ -58,3 +58,6 @@ class Config(object):
SPICY_UNDER_60 = float(os.environ.get('SPICY_UNDER_60', 1.0)) SPICY_UNDER_60 = float(os.environ.get('SPICY_UNDER_60', 1.0))
IPINFO_TOKEN = os.environ.get('IPINFO_TOKEN') or '' IPINFO_TOKEN = os.environ.get('IPINFO_TOKEN') or ''
DB_POOL_SIZE = os.environ.get('DB_POOL_SIZE') or 10
DB_MAX_OVERFLOW = os.environ.get('DB_MAX_OVERFLOW') or 30