feature-8 #9
1 changed files with 3 additions and 2 deletions
f-8: code: add readonly feature in kv db #8
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
commit
8787904833
|
|
@ -4,8 +4,9 @@ import (
|
||||||
"github.com/dgraph-io/badger/v4"
|
"github.com/dgraph-io/badger/v4"
|
||||||
)
|
)
|
||||||
|
|
||||||
func InitDB(conf Config) *badger.DB {
|
func InitDB(conf Config, readonly bool) *badger.DB {
|
||||||
opts := badger.DefaultOptions(conf.Path)
|
opts := badger.DefaultOptions(conf.Path).
|
||||||
|
WithReadOnly(readonly)
|
||||||
opts.Logger = nil
|
opts.Logger = nil
|
||||||
opts.ValueLogFileSize = 10 << 20 // 10 Mo par fichier vlog
|
opts.ValueLogFileSize = 10 << 20 // 10 Mo par fichier vlog
|
||||||
opts.NumMemtables = 1
|
opts.NumMemtables = 1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue