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