done
This commit is contained in:
@@ -44,6 +44,11 @@ async def lifespan(app: FastAPI):
|
||||
# 2. Backfill historical posts on startup (fast, no Claude API call)
|
||||
asyncio.create_task(backfill_history(AsyncSessionLocal, limit=500))
|
||||
|
||||
# 2b. Rehydrate TP/SL + max-hold backstops for any positions still open in DB.
|
||||
# Critical: without this, a redeploy/crash silently drops protection on live trades.
|
||||
from app.services.recovery import rehydrate_open_trades
|
||||
asyncio.create_task(rehydrate_open_trades())
|
||||
|
||||
# 3. Start Binance WebSocket background task
|
||||
_binance_task = asyncio.create_task(run_binance_ws(), name="binance_ws")
|
||||
logger.info("Binance WebSocket task started.")
|
||||
|
||||
Reference in New Issue
Block a user