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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user