From cd5b538b27eaa0d453b488eba6d092ffe329e703 Mon Sep 17 00:00:00 2001 From: Eray Arslan Date: Tue, 31 Oct 2023 16:33:24 +0300 Subject: [PATCH] feat: fix rollback mitigation #close --- couchbase/rollback_mitigation.go | 5 +++++ wrapper/concurrent_swiss_map.go | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/couchbase/rollback_mitigation.go b/couchbase/rollback_mitigation.go index 69b3945..3609451 100644 --- a/couchbase/rollback_mitigation.go +++ b/couchbase/rollback_mitigation.go @@ -356,6 +356,11 @@ func (r *rollbackMitigation) Start() { func (r *rollbackMitigation) Stop() { r.closed = true + if r.observeTimer != nil { + r.observeTimer.Stop() + r.observeCloseCh <- struct{}{} + <-r.observeCloseDoneCh + } r.configWatchTimer.Stop() logger.Log.Info("rollback mitigation stopped") diff --git a/wrapper/concurrent_swiss_map.go b/wrapper/concurrent_swiss_map.go index c848b18..a4db18d 100644 --- a/wrapper/concurrent_swiss_map.go +++ b/wrapper/concurrent_swiss_map.go @@ -43,7 +43,7 @@ func (m *ConcurrentSwissMap[K, V]) ToMap() map[K]V { result := make(map[K]V) m.Range(func(key K, value V) bool { result[key] = value - return false + return true }) return result }