Spaces:
Sleeping
Sleeping
Claude Code Claude Opus 4.6 commited on
Commit ·
d326b84
1
Parent(s): c5e8ea2
Claude Code: add Cain startup ready log and stderr redirect
Browse files- Add "Cain is ready" print to startup event handler for clear startup signal
- Redirect stderr to stdout in entrypoint.sh uvicorn command (2>&1)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- app.py +1 -0
- entrypoint.sh +1 -1
app.py
CHANGED
|
@@ -81,6 +81,7 @@ async def startup_event():
|
|
| 81 |
logger.warning(f">>> STARTUP: brain_minimal import failed: {e}")
|
| 82 |
|
| 83 |
logger.info(">>> STARTUP: Initialization complete, ready to serve requests")
|
|
|
|
| 84 |
|
| 85 |
|
| 86 |
@app.get("/")
|
|
|
|
| 81 |
logger.warning(f">>> STARTUP: brain_minimal import failed: {e}")
|
| 82 |
|
| 83 |
logger.info(">>> STARTUP: Initialization complete, ready to serve requests")
|
| 84 |
+
print("Cain is ready")
|
| 85 |
|
| 86 |
|
| 87 |
@app.get("/")
|
entrypoint.sh
CHANGED
|
@@ -38,7 +38,7 @@ echo "=========================================="
|
|
| 38 |
# Auto-restart loop: if uvicorn crashes, wait 2s and restart
|
| 39 |
while true; do
|
| 40 |
echo "[$(date -u +"%Y-%m-%dT%H:%M:%SZ")] Starting uvicorn on 0.0.0.0:${PORT:-7860}..."
|
| 41 |
-
uvicorn app:app --host 0.0.0.0 --port "${PORT:-7860}"
|
| 42 |
EXIT_CODE=$?
|
| 43 |
|
| 44 |
echo "[$(date -u +"%Y-%m-%dT%H:%M:%SZ")] uvicorn exited with code: $EXIT_CODE"
|
|
|
|
| 38 |
# Auto-restart loop: if uvicorn crashes, wait 2s and restart
|
| 39 |
while true; do
|
| 40 |
echo "[$(date -u +"%Y-%m-%dT%H:%M:%SZ")] Starting uvicorn on 0.0.0.0:${PORT:-7860}..."
|
| 41 |
+
uvicorn app:app --host 0.0.0.0 --port "${PORT:-7860}" 2>&1
|
| 42 |
EXIT_CODE=$?
|
| 43 |
|
| 44 |
echo "[$(date -u +"%Y-%m-%dT%H:%M:%SZ")] uvicorn exited with code: $EXIT_CODE"
|