Documentation
¶
Overview ¶
Package housekeeping trims persisted job history (Job / JobTask / JobTaskEvent) so the tables that receive hub "event" envelopes cannot grow without bound. It is a job target, not a background loop: an operator schedules or triggers "housekeeping" the same way as a sync target; nothing runs it on its own.
Index ¶
Constants ¶
View Source
const DefaultKeep = 50
DefaultKeep is how many newest finished Jobs Trim retains when the caller passes Keep < 1. Matches GET /api/jobs's list cap.
Variables ¶
This section is empty.
Functions ¶
func EffectiveKeep ¶
EffectiveKeep maps a Settings.JobHistoryKeep value onto the number Trim will actually retain. 0/negative is treated as DefaultKeep so an unset column cannot wipe history on the first run.
Types ¶
type Options ¶
type Options struct {
// Keep is the number of newest finished Jobs to retain, plus their
// JobTasks and JobTaskEvents. Values < 1 mean DefaultKeep.
Keep int
// ProtectJobIDs are never deleted, even if they are finished and
// outside the Keep window - used to spare the in-flight housekeeping
// job itself (already unfinished, but listed here as belt-and-braces).
ProtectJobIDs []uint
}
Options controls one Trim run.
Click to show internal directories.
Click to hide internal directories.