Expire idle snapshots and abandoned jobs, cap snapshot count

A background sweep every minute drops snapshots unused for an hour,
finished jobs, and uploads never committed, deleting their workspaces.
At most 8 snapshots are held; the least recently used is evicted.
This commit is contained in:
Andy Dixon
2026-02-21 09:37:43 +00:00
parent 25e2d2f390
commit 1c93df022d
3 changed files with 100 additions and 3 deletions
+2
View File
@@ -11,6 +11,7 @@ import (
"strings"
"sync"
"sync/atomic"
"time"
"unicode/utf8"
)
@@ -54,6 +55,7 @@ type Snapshot struct {
References int
Warnings []string
Root string
lastUsed time.Time
delivered map[uint32][][2]int
released map[uint32]bool
}