Spaces:
Sleeping
Sleeping
ci: deploy backend from 14cc9fdcae398fd4a9915926e6011bb9e1dc4b2b
Browse files
main.py
CHANGED
|
@@ -129,14 +129,12 @@ async def log_requests(request: Request, call_next):
|
|
| 129 |
|
| 130 |
@app.on_event("startup")
|
| 131 |
def on_startup():
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
print(f"\n\033[33m⚠️ DB init warning: {e}\033[0m")
|
| 139 |
-
threading.Thread(target=init_db, daemon=True).start()
|
| 140 |
print("\n\033[34m📡 Spender API started. Waiting for client to load initial data...\033[0m")
|
| 141 |
|
| 142 |
@app.get("/")
|
|
|
|
| 129 |
|
| 130 |
@app.on_event("startup")
|
| 131 |
def on_startup():
|
| 132 |
+
try:
|
| 133 |
+
create_db_and_tables()
|
| 134 |
+
print("\n\033[32m✅ Database initialized successfully\033[0m")
|
| 135 |
+
except Exception as e:
|
| 136 |
+
print(f"\n\033[33m⚠️ DB init warning: {e}\033[0m")
|
| 137 |
+
raise
|
|
|
|
|
|
|
| 138 |
print("\n\033[34m📡 Spender API started. Waiting for client to load initial data...\033[0m")
|
| 139 |
|
| 140 |
@app.get("/")
|