From 46d60f3d52f9915fa1e4d2f87095a299a6e4e99d Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 9 Feb 2021 18:21:36 +0300 Subject: [PATCH] [#316] ir/locode: Open LOCODE database in read-only mode Inner ring Server does not modify LOCODE database (Put method), thus it is better to open it in RO mode. Signed-off-by: Leonard Lyubich --- pkg/innerring/locode.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/innerring/locode.go b/pkg/innerring/locode.go index 09c038bf9..40e6ab418 100644 --- a/pkg/innerring/locode.go +++ b/pkg/innerring/locode.go @@ -12,7 +12,9 @@ import ( func (s *Server) newLocodeValidator(cfg *viper.Viper) (netmap.NodeValidator, error) { locodeDB := locodebolt.New(locodebolt.Prm{ Path: cfg.GetString("locode.db.path"), - }) + }, + locodebolt.ReadOnly(), + ) s.registerStarter(locodeDB.Open) s.registerIOCloser(locodeDB)