There was an error while loading. Please reload this page.
1 parent 8e83075 commit 43463feCopy full SHA for 43463fe
1 file changed
app/gunicorn.conf.py
@@ -11,6 +11,7 @@
11
12
import os
13
import threading
14
+import time
15
16
from src.app_config import config as app_config
17
from src.ingestion import rag_utils
@@ -29,5 +30,14 @@
29
30
# https://stackoverflow.com/questions/24101724/gunicorn-with-multiple-workers-is-there-an-easy-way-to-execute-certain-code-onl
31
def when_ready(server: object) -> None:
32
print("when_ready()", server)
33
+
34
+ print("populate_vector_db()")
35
populate_rag_db_thread = threading.Thread(target=rag_utils.populate_vector_db)
36
populate_rag_db_thread.start()
37
38
+ # Not sure why this is needed but without this sleep,
39
+ # pipelines can get stuck on "Running component retriever".
40
+ # Hypothesis: There's some initialization that is presenting a race condition.
41
+ time.sleep(4)
42
43
+ print("when_ready() Done")
0 commit comments