diff options
author | John Nduli | 2024-06-11 09:24:42 +0300 |
---|---|---|
committer | BonfaceKilz | 2024-06-12 11:49:43 +0300 |
commit | ae46efda7ec0e42997bec93a1ffacc29366d190b (patch) | |
tree | c4367ebd3cffe1ebdce364d5083268be5d11772e /gn3/api | |
parent | 47971099b23830e17509f1aded1faf9e2381d7c8 (diff) | |
download | genenetwork3-ae46efda7ec0e42997bec93a1ffacc29366d190b.tar.gz |
fix: use current_app's logger to log db errors
Diffstat (limited to 'gn3/api')
-rw-r--r-- | gn3/api/correlation.py | 2 | ||||
-rw-r--r-- | gn3/api/heatmaps.py | 2 | ||||
-rw-r--r-- | gn3/api/menu.py | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/gn3/api/correlation.py b/gn3/api/correlation.py index eb4cc7d..c77dd93 100644 --- a/gn3/api/correlation.py +++ b/gn3/api/correlation.py @@ -64,7 +64,7 @@ def compute_lit_corr(species=None, gene_id=None): might be needed for actual computing of the correlation results """ - with database_connection(current_app.config["SQL_URI"]) as conn: + with database_connection(current_app.config["SQL_URI"], logger=current_app.logger) as conn: target_traits_gene_ids = request.get_json() target_trait_gene_list = list(target_traits_gene_ids.items()) diff --git a/gn3/api/heatmaps.py b/gn3/api/heatmaps.py index 632c54a..172d555 100644 --- a/gn3/api/heatmaps.py +++ b/gn3/api/heatmaps.py @@ -24,7 +24,7 @@ def clustered_heatmaps(): return jsonify({ "message": "You need to provide at least two trait names." }), 400 - with database_connection(current_app.config["SQL_URI"]) as conn: + with database_connection(current_app.config["SQL_URI"], logger=current_app.logger) as conn: def parse_trait_fullname(trait): name_parts = trait.split(":") return f"{name_parts[1]}::{name_parts[0]}" diff --git a/gn3/api/menu.py b/gn3/api/menu.py index 58b761e..377ac6b 100644 --- a/gn3/api/menu.py +++ b/gn3/api/menu.py @@ -10,5 +10,5 @@ menu = Blueprint("menu", __name__) @menu.route("/generate/json") def generate_json(): """Get the menu in the JSON format""" - with database_connection(current_app.config["SQL_URI"]) as conn: + with database_connection(current_app.config["SQL_URI"], logger=current_app.logger) as conn: return jsonify(gen_dropdown_json(conn)) |