From fa8d2a5cc234472c06b287147fda15549ca39c05 Mon Sep 17 00:00:00 2001 From: Valery Piashchynski Date: Thu, 24 Jun 2021 15:51:10 +0300 Subject: - Clear BOLTDB TTL memory region on Clear RPC call Signed-off-by: Valery Piashchynski --- plugins/memory/kv.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins/memory') diff --git a/plugins/memory/kv.go b/plugins/memory/kv.go index 83f6630e..c13c2314 100644 --- a/plugins/memory/kv.go +++ b/plugins/memory/kv.go @@ -223,7 +223,7 @@ func (s *Driver) gc() { return case now := <-ticker.C: // mutes needed to clear the map - s.clearMu.Lock() + s.clearMu.RLock() // check every second s.heap.Range(func(key, value interface{}) bool { @@ -244,7 +244,7 @@ func (s *Driver) gc() { return true }) - s.clearMu.Unlock() + s.clearMu.RUnlock() } } } -- cgit v1.2.3