From 7ca39743710d4d63bf5b8d209f73306514e59b8c Mon Sep 17 00:00:00 2001 From: lash Date: Wed, 15 Jan 2025 00:08:44 +0000 Subject: [PATCH] Enable fs, mem in storageservice --- storage/storage_service.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/storage/storage_service.go b/storage/storage_service.go index 89ef122..a99a152 100644 --- a/storage/storage_service.go +++ b/storage/storage_service.go @@ -74,6 +74,14 @@ func (ms *MenuStorageService) getOrCreateDb(ctx context.Context, existingDb db.D } connStr = path.Join(connStr, section) 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 { return nil, fmt.Errorf("unsupported connection string: '%s'\n", ms.conn.String()) }