-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Simple mechanism to keep loading minimal with growing task size:
// tasks.json - active tasks only (fast to load)
// archive.json - completed/dropped tasks (loaded on demand)
fn archive_old_tasks(&mut self) {
let cutoff = Utc::now() - Duration::days(7);
let (active, archive): (Vec<_>, Vec<_>) = self.tasks
.drain(..)
.partition(|t| t.completed_at.map_or(true, |d| d > cutoff));
self.tasks = active;
append_to_archive(archive);
}This keeps active JSON small (<100 tasks typically) while preserving history. The history.jsonl you already have could serve this purpose — just need a command like eq archive or auto-archive on completed tasks older than N days.
Metadata
Metadata
Assignees
Labels
No labels