Spaces:
Running
Running
MVPilgrim
commited on
Commit
·
ddd16cb
1
Parent(s):
18cd852
install
Browse files
app.py
CHANGED
@@ -53,10 +53,21 @@ try:
|
|
53 |
# Wait for text2vec-transformers and Weaviate DB to initialize.
|
54 |
time.sleep(10)
|
55 |
#subprocess.run(["/app/cmd.sh 'ps -ef'"])
|
|
|
56 |
except Exception as e:
|
57 |
emsg = str(e)
|
58 |
-
logger.error(f"### subprocess.run
|
59 |
logger.info("### Running startup.sh complete")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
if 'runStartup' not in st.session_state:
|
61 |
st.session_state.runStartup = False
|
62 |
if 'runStartup' not in st.session_state:
|
@@ -64,12 +75,7 @@ try:
|
|
64 |
with st.spinner('If needed, initialize Weaviate DB and text2vec-transformer...'):
|
65 |
runStartup()
|
66 |
try:
|
67 |
-
|
68 |
-
with open("/app/startup.log", "r") as file:
|
69 |
-
line = file.readline().rstrip()
|
70 |
-
while line:
|
71 |
-
logger.info(line)
|
72 |
-
line = file.readline().rstrip()
|
73 |
except Exception as e2:
|
74 |
emsg = str(e2)
|
75 |
logger.error(f"#### Displaying startup.log EXCEPTION. e2: {emsg}")
|
|
|
53 |
# Wait for text2vec-transformers and Weaviate DB to initialize.
|
54 |
time.sleep(10)
|
55 |
#subprocess.run(["/app/cmd.sh 'ps -ef'"])
|
56 |
+
displayStartup.shLog()
|
57 |
except Exception as e:
|
58 |
emsg = str(e)
|
59 |
+
logger.error(f"### subprocess.run or displayStartup.shLog EXCEPTION. e: {emsg}")
|
60 |
logger.info("### Running startup.sh complete")
|
61 |
+
|
62 |
+
def displayStartup.shLog()
|
63 |
+
logger.info("### Displaying /app/startup.log")
|
64 |
+
with open("/app/startup.log", "r") as file:
|
65 |
+
line = file.readline().rstrip()
|
66 |
+
while line:
|
67 |
+
logger.info(line)
|
68 |
+
line = file.readline().rstrip()
|
69 |
+
logger.info("### End of /app/startup.log display.")
|
70 |
+
|
71 |
if 'runStartup' not in st.session_state:
|
72 |
st.session_state.runStartup = False
|
73 |
if 'runStartup' not in st.session_state:
|
|
|
75 |
with st.spinner('If needed, initialize Weaviate DB and text2vec-transformer...'):
|
76 |
runStartup()
|
77 |
try:
|
78 |
+
displayStartup.shLog()
|
|
|
|
|
|
|
|
|
|
|
79 |
except Exception as e2:
|
80 |
emsg = str(e2)
|
81 |
logger.error(f"#### Displaying startup.log EXCEPTION. e2: {emsg}")
|