Skip to content

Add scheduled runtime DB retention/compaction #159

@techmore

Description

@techmore

Problem\nRuntime logs and customer scan history are only pruned via a manual maintenance endpoint. For long‑running deployments, the SQLite runtime DB can grow unbounded, impacting performance and storage.\n\n## Evidence\n- runtime_db.apply_retention_policies exists but is only wired to /api/runtime/maintenance/retention (nmapui/handlers/routes.py).\n- No scheduled or startup invocation of retention policies.\n\n## Proposed Fix\n- Add a periodic maintenance task (e.g., daily or weekly) to run apply_retention_policies.\n- Expose retention limits in settings with sane defaults.\n- Log retention runs to runtime_logs for observability.\n\n## Notes\nThis is especially important for always‑on deployments scanning daily.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions