Skip to content

Commit

Permalink
config: allow gc to be disabled
Browse files Browse the repository at this point in the history
Signed-off-by: ldelossa <ldelossa@redhat.com>
  • Loading branch information
ldelossa authored and ldelossa committed Feb 8, 2021
1 parent 44303dc commit eb519e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Documentation/reference/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ Sets the number of update operations to retain between garbage collection cycles
This should be set to a safe MAX value based on database size constraints.
Defaults to 10
If a value of 0 is provided GC is disabled.
```

### notifier: \<object\>
Expand Down
4 changes: 3 additions & 1 deletion config/matcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ type Matcher struct {
//
// The lowest possible value is 2 in order to compare updates for notification
// purposes.
//
// A value of 0 disables GC.
UpdateRetention int `yaml:"update_retention" json:"update_retention"`
}

Expand All @@ -65,7 +67,7 @@ func (m *Matcher) Validate() error {
if m.Period == 0 {
m.Period = DefaultPeriod
}
if m.UpdateRetention < 2 {
if m.UpdateRetention == 1 || m.UpdateRetention < 0 {
m.UpdateRetention = DefaultRetention
}
return nil
Expand Down

0 comments on commit eb519e0

Please sign in to comment.