feat: Extend 1-minute data retention from 4 weeks to 1 year

- Updated lib/maintenance/data-cleanup.ts retention period: 28 days → 365 days
- Storage requirements validated: 251 MB/year (negligible)
- Rationale: 13× more historical data for better pattern analysis
- Benefits: 260-390 blocked signals/year vs 20-30/month
- Cleanup cutoff: Now Dec 2, 2024 (vs Nov 4, 2025 previously)
- Deployment verified: Container restarted, cleanup scheduled for 3 AM daily
This commit is contained in:
mindesbunister
2025-12-02 11:55:36 +01:00
parent 4239c99057
commit 5773d7d36d
11 changed files with 1191 additions and 7 deletions

View File

@@ -5836,6 +5836,31 @@ CREATE TABLE strategies (
* cc56b72 "fix: Database-first cluster status detection"
* c5a8f5e "docs: Add comprehensive cluster status fix documentation"
**Telegram Notifications (Dec 2, 2025):**
- **Purpose:** Alert user when parameter sweep completes or stops prematurely
- **Implementation:** Added to `v9_advanced_coordinator.py` (197 lines)
- **Credentials:**
* Bot Token: `8240234365:AAEm6hg_XOm54x8ctnwpNYreFKRAEvWU3uY`
* Chat ID: `579304651`
* Source: `/home/icke/traderv4/.env`
- **Notifications Sent:**
1. **Startup:** When coordinator starts (includes worker count, total combos, start time)
2. **Completion:** When all chunks finish (includes duration stats, completion time)
3. **Premature Stop:** When coordinator receives SIGINT/SIGTERM (crash/manual kill)
- **Technical Details:**
* Uses `urllib.request` for HTTP POST to Telegram Bot API
* Signal handlers registered for graceful shutdown detection
* Messages formatted with HTML parse mode for bold/structure
* 10-second timeout on HTTP requests
* Errors logged but don't crash coordinator
- **Code Locations:**
* `send_telegram_message()` function: Lines ~25-45
* `signal_handler()` function: Lines ~47-55
* Startup notification: In `main()` after banner
* Completion notification: When `pending == 0 and running == 0`
- **Deployment:** Dec 2, 2025 08:08:24 (coordinator PID 1477050)
- **User Benefit:** "works through entire dataset without having to check all the time"
**Lessons Learned:**
1. **Infrastructure availability ≠ business logic state**