File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 33# SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
44# SPDX-License-Identifier: AGPL-3.0-or-later
55#
6+
67import logging
78from os import cpu_count , getenv
89
@@ -44,6 +45,18 @@ def _setup_log_levels(debug: bool):
4445
4546
4647if __name__ == '__main__' :
48+ import multiprocessing as mp
49+
50+ # do forks from a clean process that doesn't have any threads or locks
51+ mp .set_start_method ('forkserver' )
52+ mp .set_forkserver_preload ([
53+ 'langchain' ,
54+ 'sqlalchemy' ,
55+ 'numpy' ,
56+ 'context_chat_backend.chain.ingest.injest' ,
57+ 'context_chat_backend.vectordb.pgvector' ,
58+ ])
59+
4760 logging_config = get_logging_config (LOGGER_CONFIG_NAME )
4861 setup_logging (logging_config )
4962 app_config : TConfig = app .extra ['CONFIG' ]
You can’t perform that action at this time.
0 commit comments