Skip to content

Commit a43b72b

Browse files
committed
fix: use forkserver as process start method
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
1 parent 309ab2b commit a43b72b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

main.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@
33
# SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
44
# SPDX-License-Identifier: AGPL-3.0-or-later
55
#
6+
7+
import multiprocessing as mp
8+
9+
# do forks from a clean process that doesn't have any threads or locks
10+
mp.set_start_method('forkserver')
11+
mp.set_forkserver_preload([
12+
'langchain',
13+
'sqlalchemy',
14+
'numpy',
15+
'context_chat_backend.chain.ingest.injest',
16+
'context_chat_backend.vectordb.pgvector',
17+
])
18+
619
import logging
720
from os import cpu_count, getenv
821

0 commit comments

Comments
 (0)