Files
nofx/market
ZhouYongyou bb2a4c720e fix(market): prevent program crash on WebSocket failure
## Problem
- Program crashes with log.Fatalf when WebSocket connection fails
- Triggered by WebSocket hijacking issue (157.240.12.50)
- Introduced in commit 3b1db6f (K-line WebSocket migration)
## Solution
- Replace 4x log.Fatalf with log.Printf in monitor.go
- Lines 177, 183, 189, 215
- Program now logs error and continues running
## Changes
1. Initialize failure: Fatalf → Printf (line 177)
2. Connection failure: Fatalf → Printf (line 183)
3. Subscribe failure: Fatalf → Printf (line 189)
4. K-line subscribe: Fatalf → Printf + dynamic period (line 215)
## Fallback
- System automatically uses API when WebSocket cache is empty
- GetCurrentKlines() has built-in degradation mechanism
- No data loss, slightly slower API calls as fallback
## Impact
-  Program stability: Won't crash on network issues
-  Error visibility: Clear error messages in logs
-  Data integrity: API fallback ensures K-line availability
Related: websocket-hijack-fix.md, auto-stop-bug-analysis.md
2025-11-05 02:06:54 +08:00
..
2025-11-01 15:58:54 +08:00
2025-11-01 15:58:54 +08:00
2025-11-01 15:58:54 +08:00
2025-11-01 15:58:54 +08:00
2025-11-01 15:58:54 +08:00