WIP next tracks planing

This commit is contained in:
2026-03-06 14:52:10 -05:00
parent 3336959e02
commit 2c90020682
28 changed files with 482 additions and 540 deletions

View File

@@ -664,9 +664,25 @@ class AppController:
self._set_status(f"viewing prior session: {Path(path).name} ({len(entries)} entries)")
def cb_prune_logs(self) -> None:
"""Manually triggers the log pruning process."""
self._set_status("Pruning logs...")
self._prune_old_logs()
"""Manually triggers the log pruning process with aggressive thresholds."""
self._set_status("Manual prune started (Age > 0d, Size < 100KB)...")
def run_manual_prune() -> None:
try:
from src import log_registry
from src import log_pruner
registry = log_registry.LogRegistry("logs/sessions/log_registry.toml")
pruner = log_pruner.LogPruner(registry, "logs/sessions")
# Aggressive: Prune anything not whitelisted, even if just created, if under 100KB
# Note: max_age_days=0 means cutoff is NOW.
pruner.prune(max_age_days=0, min_size_kb=100)
self._set_status("Manual prune complete.")
except Exception as e:
self._set_status(f"Manual prune error: {e}")
print(f"Error during manual log pruning: {e}")
thread = threading.Thread(target=run_manual_prune, daemon=True)
thread.start()
def _load_active_project(self) -> None:
"""Loads the active project configuration, with fallbacks."""