Skip to content

Commit

Permalink
chore: Update GarbageCollectionInterval check in NewOuroborosDB
Browse files Browse the repository at this point in the history
The code change updates the check for the GarbageCollectionInterval in the NewOuroborosDB function. Instead of checking if the interval is zero or negative, it now checks if the interval is smaller than 2 minutes. If it is, a warning message is logged and the interval is set to the default value of 5 minutes.
  • Loading branch information
i5heu committed May 18, 2024
1 parent cb47e38 commit 921cf72
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ouroboros.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ func NewOuroborosDB(conf Config) (*OuroborosDB, error) {
log = conf.Logger
}

if conf.GarbageCollectionInterval <= 0 {
conf.Logger.Warn("GarbageCollectionInterval is zero or negative; setting to default 5 minutes")
if conf.GarbageCollectionInterval < 2*time.Minute {
conf.Logger.Warn("GarbageCollectionInterval is smaller then 2 Min; setting to default 5 minutes")
conf.GarbageCollectionInterval = 5 * time.Minute
}

Expand Down

0 comments on commit 921cf72

Please sign in to comment.