f-25: code: add db api

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2026-04-30 23:29:07 +02:00
commit 0506be8a87
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632
5 changed files with 72 additions and 1 deletions

View file

@ -17,7 +17,8 @@ func InitDB(conf Config, readonly bool) *badger.DB {
opts.NumLevelZeroTablesStall = 2
db, err := badger.Open(opts)
if err != nil {
log.Fatalf("kv.InitDB (readonly=%v, path=%s): %v", readonly, conf.Path, err)
log.Printf("kv.InitDB (readonly=%v, path=%s): %v", readonly, conf.Path, err)
panic(err)
}
return db
}