Enable fs, mem in storageservice

This commit is contained in:
lash 2025-01-15 00:08:44 +00:00
parent adbfab3964
commit 7ca3974371
Signed by untrusted user who does not match committer: lash
GPG Key ID: 21D2E7BB88C2A746

View File

@ -74,6 +74,14 @@ func (ms *MenuStorageService) getOrCreateDb(ctx context.Context, existingDb db.D
} }
connStr = path.Join(connStr, section) connStr = path.Join(connStr, section)
newDb = gdbmstorage.NewThreadGdbmDb() newDb = gdbmstorage.NewThreadGdbmDb()
} else if dbTyp == DBTYPE_FS {
err = ms.ensureDbDir()
if err != nil {
return nil, err
}
newDb = fsdb.NewFsDb().WithBinary()
} else if dbTyp == DBTYPE_MEM {
logg.WarnCtxf(ctx, "using volatile storage (memdb)")
} else { } else {
return nil, fmt.Errorf("unsupported connection string: '%s'\n", ms.conn.String()) return nil, fmt.Errorf("unsupported connection string: '%s'\n", ms.conn.String())
} }