mirror of
https://tangled.org/evan.jarrett.net/at-container-registry
synced 2026-08-31 23:36:57 +00:00
23 lines
768 B
Go
23 lines
768 B
Go
// Package gc implements garbage collection for the hold service.
|
|
// It periodically cleans up orphaned blobs from S3 storage based on
|
|
// layer records in the hold's embedded PDS.
|
|
package gc
|
|
|
|
import "time"
|
|
|
|
// Hardcoded defaults - keep configuration simple
|
|
const (
|
|
// gcInterval is how often GC runs (nightly)
|
|
gcInterval = 24 * time.Hour
|
|
|
|
// gcGracePeriod is how old a layer record must be before it's considered for GC.
|
|
// Records created in the last 7 days are skipped (GDPR/CCPA compliant).
|
|
gcGracePeriod = 7 * 24 * time.Hour
|
|
)
|
|
|
|
// Config holds GC configuration
|
|
type Config struct {
|
|
// Enabled controls whether the nightly GC background process runs.
|
|
Enabled bool `yaml:"enabled" comment:"Enable nightly garbage collection of orphaned blobs and records."`
|
|
}
|