Fix issues with persist flag; Use custom logger for badger

This commit is contained in:
Pijus Kamandulis
2025-04-03 23:48:20 +03:00
parent 28e3c0c3d8
commit 598f2837af
3 changed files with 36 additions and 2 deletions

View File

@@ -15,6 +15,7 @@ type BadgerDataStoreOptions struct {
func NewBadgerDataStore(options BadgerDataStoreOptions) *BadgerDataStore {
badgerOpts := badger.DefaultOptions(options.PersistDataFilePath)
badgerOpts = badgerOpts.WithLogger(newBadgerLogger())
if options.PersistDataFilePath == "" {
badgerOpts = badgerOpts.WithInMemory(true)
}