From 5cb7fb20a0b76637861d5e807b86772d1378fd3b Mon Sep 17 00:00:00 2001 From: i5heu Date: Sat, 18 May 2024 13:19:37 +0200 Subject: [PATCH] chore: Update logging statements in keyValStore and ouroboros.go --- internal/keyValStore/keyValStore.go | 2 +- ouroboros.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/keyValStore/keyValStore.go b/internal/keyValStore/keyValStore.go index 98f222c..79a35a7 100644 --- a/internal/keyValStore/keyValStore.go +++ b/internal/keyValStore/keyValStore.go @@ -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 diff --git a/ouroboros.go b/ouroboros.go index 6f0bcb6..11bc498 100644 --- a/ouroboros.go +++ b/ouroboros.go @@ -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 } }