Implement Periodic Data Cleanup System #10

Open
opened 2025-08-24 18:17:23 +02:00 by olemd · 0 comments
Owner

Description

The application has a placeholder for periodic cleanup but no actual cleanup logic is implemented.

Current Status

  • setInterval timer exists (30 second interval)
  • No actual cleanup operations performed
  • Old trail data accumulates indefinitely
  • Stale aircraft markers may persist
  • No memory management for WebSocket clients

Expected Functionality

Aircraft Trail Cleanup

  • Remove position history older than configurable threshold (default: 1 hour)
  • Clean up trail polylines for aircraft that haven't been seen recently
  • Prevent unlimited memory growth from historical data

Stale Aircraft Cleanup

  • Remove aircraft that haven't sent updates within timeout period
  • Clear associated map markers and UI elements
  • Update aircraft count statistics

WebSocket Client Management

  • Clean up disconnected WebSocket clients
  • Remove stale client connections from broadcast lists
  • Log cleanup statistics for monitoring

Chart Data Cleanup

  • Limit historical chart data to reasonable timeframes
  • Prevent infinite data accumulation in statistics charts
  • Maintain smooth chart performance

Configuration

  • Add cleanup intervals and retention periods to config.json
  • Make cleanup behavior configurable per deployment

Files to Modify

  • assets/static/js/app.js - Implement actual cleanup logic
  • internal/merger/merger.go - Add server-side data retention
  • internal/server/server.go - WebSocket client cleanup
  • Add configuration options for cleanup behavior
## Description The application has a placeholder for periodic cleanup but no actual cleanup logic is implemented. ## Current Status - ✅ setInterval timer exists (30 second interval) - ❌ No actual cleanup operations performed - ❌ Old trail data accumulates indefinitely - ❌ Stale aircraft markers may persist - ❌ No memory management for WebSocket clients ## Expected Functionality ### Aircraft Trail Cleanup - Remove position history older than configurable threshold (default: 1 hour) - Clean up trail polylines for aircraft that haven't been seen recently - Prevent unlimited memory growth from historical data ### Stale Aircraft Cleanup - Remove aircraft that haven't sent updates within timeout period - Clear associated map markers and UI elements - Update aircraft count statistics ### WebSocket Client Management - Clean up disconnected WebSocket clients - Remove stale client connections from broadcast lists - Log cleanup statistics for monitoring ### Chart Data Cleanup - Limit historical chart data to reasonable timeframes - Prevent infinite data accumulation in statistics charts - Maintain smooth chart performance ## Configuration - Add cleanup intervals and retention periods to config.json - Make cleanup behavior configurable per deployment ## Files to Modify - assets/static/js/app.js - Implement actual cleanup logic - internal/merger/merger.go - Add server-side data retention - internal/server/server.go - WebSocket client cleanup - Add configuration options for cleanup behavior
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: olemd/skyview#10
No description provided.