Skip to content

Commit f294ebc

Browse files
sojadhavburaksezer
authored andcommitted
fix eviction for max idle duration
1 parent d575d2b commit f294ebc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

internal/dmap/eviction.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"math/rand"
2121
"runtime"
2222
"sort"
23+
"strings"
2324
"time"
2425

2526
"github.com/olric-data/olric/internal/cluster/partitions"
@@ -102,8 +103,9 @@ func (s *Service) evictKeys() {
102103
partID := uint64(rand.Intn(int(s.config.PartitionCount)))
103104
part := s.primary.PartitionByID(partID)
104105
part.Map().Range(func(name, tmp interface{}) bool {
106+
dmapName := strings.TrimPrefix(name.(string), "dmap.")
105107
f := tmp.(*fragment)
106-
s.scanFragmentForEviction(partID, name.(string), f)
108+
s.scanFragmentForEviction(partID, dmapName, f)
107109
// this breaks the loop, we only scan one dmap instance per call
108110
return false
109111
})

0 commit comments

Comments
 (0)