diff options
| author | Frederick Muriuki Muriithi | 2025-10-22 13:27:54 -0500 |
|---|---|---|
| committer | Frederick Muriuki Muriithi | 2025-10-22 13:27:54 -0500 |
| commit | 05013c13710eccadb69746bf186eb672c2af69c4 (patch) | |
| tree | 71a706fd30bf0d535a0fab737bb0e42a1667e60b /gn3/api/correlation.py | |
| parent | 977efbb54da284fb3e8476f200206d00cb8e64cd (diff) | |
| download | genenetwork3-05013c13710eccadb69746bf186eb672c2af69c4.tar.gz | |
Fetch configs from app setting and pass them down
Fix the code to avoid using global variables holding configuration variables to avoid the failures caused by action-at-a-distance effects due to change of a value elsewhere. This way, all code consistently receives the same configuration values passed on from callers. We pass on the following configuration settings: * TMPDIR * SQL_URI * TEXTDIR
Diffstat (limited to 'gn3/api/correlation.py')
| -rw-r--r-- | gn3/api/correlation.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gn3/api/correlation.py b/gn3/api/correlation.py index 6af96d7..3667a24 100644 --- a/gn3/api/correlation.py +++ b/gn3/api/correlation.py @@ -9,7 +9,6 @@ from flask import Blueprint from flask import request from flask import current_app -from gn3.settings import SQL_URI from gn3.db_utils import database_connection from gn3.commands import run_sample_corr_cmd from gn3.responses.pcorrs_responses import build_response @@ -144,7 +143,10 @@ def partial_correlation(): cmd=command, job_queue=compute_job_queue(current_app), options={ - "env": {"PYTHONPATH": ":".join(sys.path), "SQL_URI": SQL_URI}, + "env": { + "PYTHONPATH": ":".join(sys.path), + "SQL_URI": current_app.config["SQL_URI"] + }, }, log_level=logging.getLevelName( current_app.logger.getEffectiveLevel()).lower()) |
