[#949] metabase: fix metabase mode metric

It used to always show CLOSED regardless of actual mode.
Now metric represents actual metabase mode of operations.

Signed-off-by: Ekaterina Lebedeva <ekaterina.lebedeva@yadro.com>
This commit is contained in:
Ekaterina Lebedeva 2024-03-19 01:03:46 +03:00
parent e12fcc041d
commit 81a0346a96

View file

@ -42,6 +42,7 @@ func (db *DB) Open(_ context.Context, mode mode.Mode) error {
db.modeMtx.Lock() db.modeMtx.Lock()
defer db.modeMtx.Unlock() defer db.modeMtx.Unlock()
db.mode = mode db.mode = mode
db.metrics.SetMode(mode)
if mode.NoMetabase() { if mode.NoMetabase() {
return nil return nil