Documentation
¶
Overview ¶
Package gc provides garbage collection for log files in the .tick directory. It cleans up old log files to prevent unbounded growth of:
- .tick/activity/activity.jsonl (trims old entries)
- .tick/logs/records/*.json (deletes old run records)
- .tick/logs/runs/*.jsonl (deletes old run logs)
- .tick/logs/checkpoints/*.json (deletes old checkpoints)
- .tick/logs/context/*.md (deletes old context files)
Files with .live.json suffix are always skipped as they represent in-progress operations.
Index ¶
Constants ¶
View Source
const DefaultMaxAge = 30 * 24 * time.Hour // 30 days
DefaultMaxAge is the default age threshold for deleting old files.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cleaner ¶
type Cleaner struct {
// contains filtered or unexported fields
}
Cleaner handles garbage collection for log files.
func NewCleaner ¶
NewCleaner creates a new garbage collector.
func (*Cleaner) WithDryRun ¶
WithDryRun sets dry-run mode (report only, don't delete).
func (*Cleaner) WithMaxAge ¶
WithMaxAge sets the maximum age for files to keep.
type Result ¶
type Result struct {
// FilesDeleted is the total number of files deleted.
FilesDeleted int
// BytesFreed is the total bytes freed from deleted files.
BytesFreed int64
// EntriesTrimmed is the number of entries trimmed from activity.jsonl.
EntriesTrimmed int
// Errors contains any non-fatal errors encountered during cleanup.
Errors []error
}
Result contains statistics from a cleanup run.
Click to show internal directories.
Click to hide internal directories.