Skip to content

Commit

Permalink
chore: Update logging statements in keyValStore and ouroboros.go
Browse files Browse the repository at this point in the history
  • Loading branch information
i5heu committed May 18, 2024
1 parent 7b4e74e commit 5cb7fb2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/keyValStore/keyValStore.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ func (k *KeyValStore) Clean() error {
if err != nil {
return fmt.Errorf("error flattening db: %w", err)
} else {
fmt.Println("Compaction completed successfully.")
log.Info("DB Flattened")
}

// clean badgerDB
Expand Down
4 changes: 2 additions & 2 deletions ouroboros.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ func (ou *OuroborosDB) createGarbageCollection() {
ticker := time.NewTicker(ou.config.GarbageCollectionInterval)
for range ticker.C {
err := ou.DB.GarbageCollection()
fmt.Println("Garbage Collection", badger.ErrNoRewrite)
if err != nil {
log.Info("Garbage Collection", badger.ErrNoRewrite)
if err != nil && err != badger.ErrNoRewrite {
log.Fatal("Error during garbage collection: ", err) // maybe we have to rework this here a bit
}
}
Expand Down

0 comments on commit 5cb7fb2

Please sign in to comment.