Files
trading_bot_v4/sweep_v9_optimized.csv
mindesbunister cc56b72df2 fix: Database-first cluster status detection + Stop button clarification
CRITICAL FIX (Nov 30, 2025):
- Dashboard showed 'idle' despite 22+ worker processes running
- Root cause: SSH-based worker detection timing out
- Solution: Check database for running chunks FIRST

Changes:
1. app/api/cluster/status/route.ts:
   - Query exploration database before SSH detection
   - If running chunks exist, mark workers 'active' even if SSH fails
   - Override worker status: 'offline' → 'active' when chunks running
   - Log: ' Cluster status: ACTIVE (database shows running chunks)'
   - Database is source of truth, SSH only for supplementary metrics

2. app/cluster/page.tsx:
   - Stop button ALREADY EXISTS (conditionally shown)
   - Shows Start when status='idle', Stop when status='active'
   - No code changes needed - fixed by status detection

Result:
- Dashboard now shows 'ACTIVE' with 2 workers (correct)
- Workers show 'active' status (was 'offline')
- Stop button automatically visible when cluster active
- System resilient to SSH timeouts/network issues

Verified:
- Container restarted: Nov 30 21:18 UTC
- API tested: Returns status='active', activeWorkers=2
- Logs confirm: Database-first logic working
- Workers confirmed running: 22+ processes on worker1, workers on worker2
2025-11-30 22:23:01 +01:00

3.6 KiB

1flip_threshold_percentma_gap_thresholdmomentum_min_adxmomentum_long_max_posmomentum_short_min_poscooldown_barsmomentum_spacingmomentum_cooldowntradestotal_pnlwin_rateavg_pnlmax_drawdownprofit_factor
20.650.424.070.030.0343568496.4142482134737461.091549295774650.8739687468547073-1270.03862679919281.0270047211280526
30.60.422.070.030.0343568496.4142482134737461.091549295774650.8739687468547073-1270.03862679919281.0270047211280526
40.650.423.070.030.0343568496.4142482134737461.091549295774650.8739687468547073-1270.03862679919281.0270047211280526
50.650.422.070.030.0343568496.4142482134737461.091549295774650.8739687468547073-1270.03862679919281.0270047211280526
60.650.3524.070.030.0343568496.4142482134737461.091549295774650.8739687468547073-1270.03862679919281.0270047211280526
70.650.3523.070.030.0343568496.4142482134737461.091549295774650.8739687468547073-1270.03862679919281.0270047211280526
80.550.422.070.030.0343568496.4142482134737461.091549295774650.8739687468547073-1270.03862679919281.0270047211280526
90.650.3522.070.030.0343568496.4142482134737461.091549295774650.8739687468547073-1270.03862679919281.0270047211280526
100.550.423.070.030.0343568496.4142482134737461.091549295774650.8739687468547073-1270.03862679919281.0270047211280526
110.550.424.070.030.0343568496.4142482134737461.091549295774650.8739687468547073-1270.03862679919281.0270047211280526
120.60.424.070.030.0343568496.4142482134737461.091549295774650.8739687468547073-1270.03862679919281.0270047211280526
130.60.423.070.030.0343568496.4142482134737461.091549295774650.8739687468547073-1270.03862679919281.0270047211280526
140.650.324.070.030.0343569405.8773059876201660.984182776801410.7133168822278034-1360.57556902504671.021971337907867
150.650.323.070.030.0343569405.8773059876201660.984182776801410.7133168822278034-1360.57556902504671.021971337907867
160.650.322.070.030.0343569405.8773059876201660.984182776801410.7133168822278034-1360.57556902504671.021971337907867
170.550.3523.070.030.0343569405.8773059876201660.984182776801410.7133168822278034-1360.57556902504671.021971337907867
180.60.3524.070.030.0343569405.8773059876201660.984182776801410.7133168822278034-1360.57556902504671.021971337907867
190.550.324.070.030.0343569405.8773059876201660.984182776801410.7133168822278034-1360.57556902504671.021971337907867
200.60.3522.070.030.0343569405.8773059876201660.984182776801410.7133168822278034-1360.57556902504671.021971337907867
210.60.323.070.030.0343569405.8773059876201660.984182776801410.7133168822278034-1360.57556902504671.021971337907867
220.60.324.070.030.0343569405.8773059876201660.984182776801410.7133168822278034-1360.57556902504671.021971337907867
230.60.322.070.030.0343569405.8773059876201660.984182776801410.7133168822278034-1360.57556902504671.021971337907867
240.550.323.070.030.0343569405.8773059876201660.984182776801410.7133168822278034-1360.57556902504671.021971337907867
250.550.322.070.030.0343569405.8773059876201660.984182776801410.7133168822278034-1360.57556902504671.021971337907867
260.550.3524.070.030.0343569405.8773059876201660.984182776801410.7133168822278034-1360.57556902504671.021971337907867
270.550.3522.070.030.0343569405.8773059876201660.984182776801410.7133168822278034-1360.57556902504671.021971337907867
280.60.3523.070.030.0343569405.8773059876201660.984182776801410.7133168822278034-1360.57556902504671.021971337907867