From ed726c705404098f4a519b7028d69bc560ffc805 Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Mon, 5 Sep 2022 10:30:53 +0300 Subject: Remove sql_alchemy initialisation when profiling correlations * wqflask/scripts/profile_corrs.py: Remove sqlalchemy, connect_db and shutdown_session. (__main__): Remove "g.db". --- wqflask/scripts/profile_corrs.py | 7 ------- 1 file changed, 7 deletions(-) (limited to 'wqflask/scripts') diff --git a/wqflask/scripts/profile_corrs.py b/wqflask/scripts/profile_corrs.py index 1badeb70..a42e2935 100644 --- a/wqflask/scripts/profile_corrs.py +++ b/wqflask/scripts/profile_corrs.py @@ -3,14 +3,12 @@ import sys import pstats import cProfile -import sqlalchemy from flask import g, request from utility.startup_config import app_config from wqflask import app from wqflask.user_session import UserSession -from wqflask.views import connect_db, shutdown_session from wqflask.correlation.correlation_gn3_api import compute_correlation def sample_vals(): @@ -65,10 +63,5 @@ if __name__ == "__main__": app_config() with app.app_context(): with app.test_request_context("/corr_compute", data=simulated_form()): - g.db = sqlalchemy.create_engine( ## Setup global db connection - app.config.get('SQL_URI'), encoding="latin1") g.user_session = UserSession() main() - ## dispose global db connection - g.db.dispose() - g.db.close() -- cgit v1.2.3