From 0b2ab30a3da8eefa9cbc246e27dd33cbb3f2bbbf Mon Sep 17 00:00:00 2001 From: yedf2 <120050102@qq.com> Date: Tue, 17 May 2022 21:55:18 +0800 Subject: [PATCH] call Seek in bolt scan --- dtmsvr/storage/boltdb/boltdb.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dtmsvr/storage/boltdb/boltdb.go b/dtmsvr/storage/boltdb/boltdb.go index b705a5b..cee6c29 100644 --- a/dtmsvr/storage/boltdb/boltdb.go +++ b/dtmsvr/storage/boltdb/boltdb.go @@ -276,7 +276,7 @@ func (s *Store) ScanTransGlobalStores(position *string, limit int64) []storage.T globals := []storage.TransGlobalStore{} err := s.boltDb.View(func(t *bolt.Tx) error { cursor := t.Bucket(bucketGlobal).Cursor() - for k, v := cursor.First(); k != nil; k, v = cursor.Next() { + for k, v := cursor.Seek([]byte(*position)); k != nil; k, v = cursor.Next() { if string(k) == *position { continue }