mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-12-02 20:03:01 +01:00
Remove config lock from the state
This commit is contained in:
parent
ecd005cac0
commit
05b7542115
2 changed files with 0 additions and 5 deletions
|
@ -115,15 +115,11 @@ def configure_server(
|
||||||
try:
|
try:
|
||||||
state.embeddings_model = EmbeddingsModel(get_or_create_search_model().bi_encoder)
|
state.embeddings_model = EmbeddingsModel(get_or_create_search_model().bi_encoder)
|
||||||
state.cross_encoder_model = CrossEncoderModel(get_or_create_search_model().cross_encoder)
|
state.cross_encoder_model = CrossEncoderModel(get_or_create_search_model().cross_encoder)
|
||||||
|
|
||||||
state.config_lock.acquire()
|
|
||||||
state.SearchType = configure_search_types()
|
state.SearchType = configure_search_types()
|
||||||
state.search_models = configure_search(state.search_models, state.config.search_type)
|
state.search_models = configure_search(state.search_models, state.config.search_type)
|
||||||
initialize_content(regenerate, search_type, init, user)
|
initialize_content(regenerate, search_type, init, user)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise e
|
raise e
|
||||||
finally:
|
|
||||||
state.config_lock.release()
|
|
||||||
|
|
||||||
|
|
||||||
def initialize_content(regenerate: bool, search_type: Optional[SearchType] = None, init=False, user: KhojUser = None):
|
def initialize_content(regenerate: bool, search_type: Optional[SearchType] = None, init=False, user: KhojUser = None):
|
||||||
|
|
|
@ -27,7 +27,6 @@ host: str = None
|
||||||
port: int = None
|
port: int = None
|
||||||
cli_args: List[str] = None
|
cli_args: List[str] = None
|
||||||
query_cache: Dict[str, LRU] = defaultdict(LRU)
|
query_cache: Dict[str, LRU] = defaultdict(LRU)
|
||||||
config_lock = threading.Lock()
|
|
||||||
chat_lock = threading.Lock()
|
chat_lock = threading.Lock()
|
||||||
SearchType = utils_config.SearchType
|
SearchType = utils_config.SearchType
|
||||||
telemetry: List[Dict[str, str]] = []
|
telemetry: List[Dict[str, str]] = []
|
||||||
|
|
Loading…
Reference in a new issue