Merge pull request #1380 from CTFd/add-sqlalchemy-engine-options

* Add `SQLALCHEMY_ENGINE_OPTIONS` to `config.py` to specify a slightly higher default `max_overflow`
mark-2.4.1
Kevin Chung 2020-05-05 21:19:46 -04:00 committed by GitHub
commit 05da93b4f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -231,6 +231,11 @@ class Config(object):
SERVER_SENT_EVENTS: SERVER_SENT_EVENTS:
Specifies whether or not to enable to server-sent events based Notifications system. Specifies whether or not to enable to server-sent events based Notifications system.
SQLALCHEMY_ENGINE_OPTIONS:
A dictionary of keyword args to send to the underlying SQLAlchemy create_engine() call.
https://docs.sqlalchemy.org/en/13/core/engines.html#sqlalchemy.create_engine
https://flask-sqlalchemy.palletsprojects.com/en/2.x/config/#configuration-keys
""" """
REVERSE_PROXY = os.getenv("REVERSE_PROXY") or False REVERSE_PROXY = os.getenv("REVERSE_PROXY") or False
TEMPLATES_AUTO_RELOAD = not os.getenv("TEMPLATES_AUTO_RELOAD") # Defaults True TEMPLATES_AUTO_RELOAD = not os.getenv("TEMPLATES_AUTO_RELOAD") # Defaults True
@ -241,6 +246,10 @@ class Config(object):
UPDATE_CHECK = not os.getenv("UPDATE_CHECK") # Defaults True UPDATE_CHECK = not os.getenv("UPDATE_CHECK") # Defaults True
APPLICATION_ROOT = os.getenv("APPLICATION_ROOT") or "/" APPLICATION_ROOT = os.getenv("APPLICATION_ROOT") or "/"
SERVER_SENT_EVENTS = not os.getenv("SERVER_SENT_EVENTS") # Defaults True SERVER_SENT_EVENTS = not os.getenv("SERVER_SENT_EVENTS") # Defaults True
if DATABASE_URL.startswith("sqlite") is False:
SQLALCHEMY_ENGINE_OPTIONS = {
"max_overflow": int(os.getenv("SQLALCHEMY_MAX_OVERFLOW", 20))
}
""" """
=== OAUTH === === OAUTH ===