INNER CODE UNIT · Python
startup
GifariKemal/xaubot-ai · web-dashboard/api/main.py:80
async def startup():
try:
db.init_pool()
logger.info("DB pool ready")
except Exception as e:
logger.warning("DB not available: %s (trade history features disabled)", e)
@app.on_event("shutdown")
async def shutdown():
db.close_pool()
# ─── Status Endpoints ───
@app.get("/api/status")
async def get_status():
"""Get current trading status from bot's status file."""