Spaces:
Sleeping
Sleeping
Claude Code commited on
Commit ·
e1064e4
1
Parent(s): 3eb8441
Claude Code: Add debug prints to track uvicorn startup sequence
Browse files
app.py
CHANGED
|
@@ -251,10 +251,15 @@ def get_agents():
|
|
| 251 |
# CRITICAL: Main block to ensure uvicorn.run() executes immediately
|
| 252 |
# This ensures server binds to 0.0.0.0:7860 regardless of agent initialization
|
| 253 |
if __name__ == "__main__":
|
|
|
|
| 254 |
import uvicorn
|
| 255 |
logger.info("[MAIN] Starting uvicorn server directly - binding to 0.0.0.0:7860")
|
| 256 |
logger.info(f"[MAIN] STARTUP_MODE={STARTUP_MODE}")
|
| 257 |
uvicorn.run(app, host="0.0.0.0", port=7860)
|
|
|
|
| 258 |
else:
|
| 259 |
# Module import path (via entrypoint.sh: uvicorn app:app)
|
|
|
|
| 260 |
logger.info("[MAIN] App module imported - FastAPI app created, waiting for uvicorn to bind")
|
|
|
|
|
|
|
|
|
| 251 |
# CRITICAL: Main block to ensure uvicorn.run() executes immediately
|
| 252 |
# This ensures server binds to 0.0.0.0:7860 regardless of agent initialization
|
| 253 |
if __name__ == "__main__":
|
| 254 |
+
print(">>> PRE-UVICORN CHECK <<<")
|
| 255 |
import uvicorn
|
| 256 |
logger.info("[MAIN] Starting uvicorn server directly - binding to 0.0.0.0:7860")
|
| 257 |
logger.info(f"[MAIN] STARTUP_MODE={STARTUP_MODE}")
|
| 258 |
uvicorn.run(app, host="0.0.0.0", port=7860)
|
| 259 |
+
print(">>> POST-UVICORN CHECK <<<")
|
| 260 |
else:
|
| 261 |
# Module import path (via entrypoint.sh: uvicorn app:app)
|
| 262 |
+
print(">>> PRE-UVICORN CHECK (MODULE IMPORT) <<<")
|
| 263 |
logger.info("[MAIN] App module imported - FastAPI app created, waiting for uvicorn to bind")
|
| 264 |
+
logger.info(f"[MAIN] STARTUP_MODE={STARTUP_MODE}")
|
| 265 |
+
print(">>> APP READY FOR UVICORN EXTERNAL START <<<")
|