[#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()
defer db.modeMtx.Unlock()
db.mode = mode
db.metrics.SetMode(mode)
if mode.NoMetabase() {
return nil