diff --git a/bakta/ips.py b/bakta/ips.py index 4961b19c..d2973be5 100644 --- a/bakta/ips.py +++ b/bakta/ips.py @@ -27,7 +27,7 @@ def lookup(features): features_found = [] features_not_found = [] rec_futures = [] - with sqlite3.connect(f"file:{cfg.db_path.joinpath('bakta.db')}?mode=ro", uri=True, check_same_thread=False) as conn: + with sqlite3.connect(f"file:{cfg.db_path.joinpath('bakta.db')}?mode=ro&nolock=1&cache=shared", uri=True, check_same_thread=False) as conn: conn.execute('PRAGMA omit_readlock;') conn.row_factory = sqlite3.Row with ThreadPoolExecutor(max_workers=max(10, cfg.threads)) as tpe: # use min 10 threads for IO bound non-CPU lookups diff --git a/bakta/psc.py b/bakta/psc.py index 1ad7c127..d500861c 100644 --- a/bakta/psc.py +++ b/bakta/psc.py @@ -99,7 +99,7 @@ def lookup(features): no_psc_lookups = 0 try: rec_futures = [] - with sqlite3.connect(f"file:{cfg.db_path.joinpath('bakta.db')}?mode=ro", uri=True, check_same_thread=False) as conn: + with sqlite3.connect(f"file:{cfg.db_path.joinpath('bakta.db')}?mode=ro&nolock=1&cache=shared", uri=True, check_same_thread=False) as conn: conn.execute('PRAGMA omit_readlock;') conn.row_factory = sqlite3.Row with ThreadPoolExecutor(max_workers=max(10, cfg.threads)) as tpe: # use min 10 threads for IO bound non-CPU lookups diff --git a/bakta/pscc.py b/bakta/pscc.py index 211d6d0b..0c586b98 100644 --- a/bakta/pscc.py +++ b/bakta/pscc.py @@ -22,7 +22,7 @@ def lookup(features): no_pscc_lookups = 0 try: rec_futures = [] - with sqlite3.connect(f"file:{cfg.db_path.joinpath('bakta.db')}?mode=ro", uri=True, check_same_thread=False) as conn: + with sqlite3.connect(f"file:{cfg.db_path.joinpath('bakta.db')}?mode=ro&nolock=1&cache=shared", uri=True, check_same_thread=False) as conn: conn.execute('PRAGMA omit_readlock;') conn.row_factory = sqlite3.Row with ThreadPoolExecutor(max_workers=max(10, cfg.threads)) as tpe: # use min 10 threads for IO bound non-CPU lookups diff --git a/bakta/ups.py b/bakta/ups.py index 974ed6db..1600ca4c 100644 --- a/bakta/ups.py +++ b/bakta/ups.py @@ -26,7 +26,7 @@ def lookup(features): features_found = [] features_not_found = [] rec_futures = [] - with sqlite3.connect(f"file:{cfg.db_path.joinpath('bakta.db')}?mode=ro", uri=True, check_same_thread=False) as conn: + with sqlite3.connect(f"file:{cfg.db_path.joinpath('bakta.db')}?mode=ro&nolock=1&cache=shared", uri=True, check_same_thread=False) as conn: conn.execute('PRAGMA omit_readlock;') conn.row_factory = sqlite3.Row with ThreadPoolExecutor(max_workers=max(10, cfg.threads)) as tpe: # use min 10 threads for IO bound non-CPU lookups