Skip to content

Commit

Permalink
fix: option setting
Browse files Browse the repository at this point in the history
Signed-off-by: hlts2 <[email protected]>
  • Loading branch information
hlts2 committed Jan 24, 2024
1 parent d53e69e commit c98c4c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/db/kvs/pogreb/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func WithBackgroundSyncInterval(s string) Option {
if d.opts == nil {
d.opts = new(pogreb.Options)
}
if dur < 0 {
if dur < -1 {
dur = -1
}

Check warning on line 57 in internal/db/kvs/pogreb/options.go

View check run for this annotation

Codecov / codecov/patch

internal/db/kvs/pogreb/options.go#L56-L57

Added lines #L56 - L57 were not covered by tests
d.opts.BackgroundSyncInterval = dur
Expand All @@ -76,7 +76,7 @@ func WithBackgroundCompactionInterval(s string) Option {
}

if dur < 0 {
dur = -1
dur = 0
}

Check warning on line 80 in internal/db/kvs/pogreb/options.go

View check run for this annotation

Codecov / codecov/patch

internal/db/kvs/pogreb/options.go#L79-L80

Added lines #L79 - L80 were not covered by tests
d.opts.BackgroundCompactionInterval = dur
return nil
Expand Down

0 comments on commit c98c4c4

Please sign in to comment.