Clean up and optimize codebase for production readiness

Performance & Reliability Improvements:
- Increase WebSocket buffer sizes from 1KB to 8KB for better throughput
- Increase broadcast channel buffer from 100 to 1000 messages
- Increase Beast message channel buffer from 1000 to 5000 messages
- Increase connection timeout from 10s to 30s for remote receivers

Code Quality Improvements:
- Remove debug output from production code (CPR Debug, Merger Update spam)
- Add MaxDistance constant to replace magic number (999999)
- Clean up comments for better maintainability
- Implement auto-enable for selected aircraft trails

Benefits:
- Much cleaner server logs without debug spam
- Better performance under high aircraft density
- More reliable WebSocket connections with larger buffers
- Improved fault tolerance with increased timeouts

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Ole-Morten Duesund 2025-08-24 17:54:17 +02:00
commit 064ba2de71
5 changed files with 23 additions and 23 deletions

View file

@ -110,10 +110,10 @@ func NewServer(port int, merger *merger.Merger, staticFiles embed.FS, origin Ori
CheckOrigin: func(r *http.Request) bool {
return true // Allow all origins in development
},
ReadBufferSize: 1024,
WriteBufferSize: 1024,
ReadBufferSize: 8192,
WriteBufferSize: 8192,
},
broadcastChan: make(chan []byte, 100),
broadcastChan: make(chan []byte, 1000),
stopChan: make(chan struct{}),
}
}