From a3414b36dde7a4a3f6ac65b2f878679600068557 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 3 Nov 2021 07:42:50 +0300 Subject: [PATCH] [#958] cli/locode: Open RO database in `info` command CLI `util locode info` command does not write operations. Opening a `locodebolt.DB` instance in RW mode is redundant. Provide `locodebolt.ReadOnly()` option to `locodebolt.DB` constructor in order to create READ flock over BoltDB file. Signed-off-by: Leonard Lyubich --- cmd/neofs-cli/modules/util.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/neofs-cli/modules/util.go b/cmd/neofs-cli/modules/util.go index 48a387aa6c..9c2f95c25a 100644 --- a/cmd/neofs-cli/modules/util.go +++ b/cmd/neofs-cli/modules/util.go @@ -159,7 +159,7 @@ var ( Run: func(cmd *cobra.Command, _ []string) { targetDB := locodebolt.New(locodebolt.Prm{ Path: locodeInfoDBPath, - }) + }, locodebolt.ReadOnly()) err := targetDB.Open() exitOnErr(cmd, err)