mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-05 05:39:11 +00:00
Lock the index before updating it via API or Scheduler
- There are 3 paths to updating/setting the index (stored in state.model) - App start - API - Scheduler - Put all updates to the index behind a lock. As multiple updates path that could (potentially) run at the same time (via API or Scheduler)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
# Standard Packages
|
||||
import threading
|
||||
from packaging import version
|
||||
|
||||
# External Packages
|
||||
@@ -20,6 +21,7 @@ host: str = None
|
||||
port: int = None
|
||||
cli_args: list[str] = None
|
||||
query_cache = LRU()
|
||||
search_index_lock = threading.Lock()
|
||||
|
||||
if torch.cuda.is_available():
|
||||
# Use CUDA GPU
|
||||
|
||||
Reference in New Issue
Block a user