[#576] Set SyncWrites for badger writecache by default

Signed-off-by: Alejandro Lopez <a.lopez@yadro.com>
This commit is contained in:
Alejandro Lopez 2023-08-09 11:28:26 +03:00
parent 8d589314b5
commit ae322e9f73
3 changed files with 1 additions and 13 deletions

View file

@ -11,6 +11,7 @@ import (
func OpenDB(p string, ro bool, l *logger.Logger) (*badger.DB, error) {
return badger.Open(badger.DefaultOptions(p).
WithReadOnly(ro).
WithSyncWrites(true).
WithLoggingLevel(badger.ERROR).
WithLogger(badgerLoggerWrapper{l}))
}