[#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 <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-11-03 07:42:50 +03:00 committed by LeL
parent cee4f3142f
commit a3414b36dd

View file

@ -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)