1402 sqlalchemy optimization exploration (#1450)

* Experimental ideas to make SQLAlchemy queries faster by switching them to SQLAlchemy Core
* Starts work on #1402
This commit is contained in:
Kevin Chung
2020-05-29 00:55:40 -04:00
committed by GitHub
parent f2dc702681
commit 970e1ca65e
2 changed files with 9 additions and 3 deletions

View File

@@ -23,7 +23,9 @@ def get_app_config(key, default=None):
@cache.memoize()
def _get_config(key):
config = Configs.query.filter_by(key=key).first()
config = db.session.execute(
Configs.__table__.select().where(Configs.key == key)
).fetchone()
if config and config.value:
value = config.value
if value and value.isdigit():