aboutsummaryrefslogtreecommitdiff
path: root/gn3/db_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'gn3/db_utils.py')
-rw-r--r--gn3/db_utils.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/gn3/db_utils.py b/gn3/db_utils.py
index af1024a..4fd3666 100644
--- a/gn3/db_utils.py
+++ b/gn3/db_utils.py
@@ -4,7 +4,7 @@ from typing import Any, Iterator, Protocol, Tuple
from urllib.parse import urlparse
import MySQLdb as mdb
import xapian
-from gn3.settings import SQL_URI, XAPIAN_DB_PATH
+from gn3.settings import SQL_URI
def parse_db_url() -> Tuple:
@@ -47,10 +47,10 @@ def database_connection() -> Iterator[Connection]:
@contextlib.contextmanager
-def xapian_database():
+def xapian_database(path):
"""Open xapian database read-only."""
# pylint: disable-next=invalid-name
- db = xapian.Database(XAPIAN_DB_PATH)
+ db = xapian.Database(path)
try:
yield db
finally: