Update app.py
Browse files
app.py
CHANGED
|
@@ -31,6 +31,14 @@ from components.chat import display_chat_interface
|
|
| 31 |
|
| 32 |
# Create locks for thread-safe operations
|
| 33 |
conn_lock = Lock()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
def verify_database_tables(conn):
|
| 36 |
"""Verify that all required tables exist."""
|
|
|
|
| 31 |
|
| 32 |
# Create locks for thread-safe operations
|
| 33 |
conn_lock = Lock()
|
| 34 |
+
if not os.path.exists('/data'):
|
| 35 |
+
try:
|
| 36 |
+
from setup import setup_directories
|
| 37 |
+
if not setup_directories():
|
| 38 |
+
raise Exception("Failed to set up directories")
|
| 39 |
+
except Exception as e:
|
| 40 |
+
st.error(f"Setup error: {e}")
|
| 41 |
+
st.stop()
|
| 42 |
|
| 43 |
def verify_database_tables(conn):
|
| 44 |
"""Verify that all required tables exist."""
|