aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander_Kabui2024-03-26 14:54:37 +0300
committerAlexander_Kabui2024-03-26 14:54:37 +0300
commite11b70129326c1e92743792647a4d92b6703e621 (patch)
treef4396875edaed8168962e7c8aa5b408fece550f4
parent6fd0320510339d18a6d032e3df8c528a94c966df (diff)
downloadgenenetwork3-e11b70129326c1e92743792647a4d92b6703e621.tar.gz
add sqlite-db-path config
-rw-r--r--gn3/api/llm.py8
-rw-r--r--gn3/settings.py5
2 files changed, 7 insertions, 6 deletions
diff --git a/gn3/api/llm.py b/gn3/api/llm.py
index 661d055..1e84bcf 100644
--- a/gn3/api/llm.py
+++ b/gn3/api/llm.py
@@ -13,7 +13,7 @@ from gn3.llms.process import get_user_queries
from gn3.llms.process import fetch_query_results
from gn3.auth.authorisation.oauth2.resource_server import require_oauth
from gn3.auth import db
-
+from gn3.settings import SQLITE_DB_PATH
from redis import Redis
import os
@@ -77,11 +77,7 @@ def rating(task_id):
results.get("answer"),
results.get("weight", 0))
- # get base name for sqlite
- llm_path = os.path.join(os.path.dirname(
- current_app.config["AUTH_DB"]), "llm.db")
- logging.info("lmdb path is %s",llm_path)
- with db.connection(llm_path) as conn:
+ with db.connection(os.path.join(SQLITE_DB_PATH, "llm.db")) as conn:
cursor = conn.cursor()
create_table = """CREATE TABLE IF NOT EXISTS Rating(
user_id TEXT NOT NULL,
diff --git a/gn3/settings.py b/gn3/settings.py
index 769a5b2..61de405 100644
--- a/gn3/settings.py
+++ b/gn3/settings.py
@@ -55,6 +55,11 @@ GENOTYPE_FILES = os.environ.get(
# Xapian index
XAPIAN_DB_PATH = "xapian"
+# sqlite path
+
+SQLITE_DB_PATH = os.environ.get(
+ "SQLITE_DB_PATH", "/export/data/genenetwork-sqlite/")
+
# CROSS-ORIGIN SETUP