-
-
Notifications
You must be signed in to change notification settings - Fork 41
Closed
Description
Related codes
cacheStore := cache.New(cache.AsLFU[string, SomeStruct](lfu.WithCapacity(5)))
cacheStore.Set(someKey, someValue, cache.WithExpiration(10 * time.Second))
Logs
panic: runtime error: index out of range [-1]
goroutine 71 [running]:
github.com/Code-Hex/go-generics-cache/policy/lfu.priorityQueue[...].Swap(...)
github.com/Code-Hex/[email protected]/policy/lfu/priotiry_queue.go:51
container/heap.Remove({0x1e0c8c0, 0xc0006982b8}, 0xffffffffffffffff)
container/heap/heap.go:72 +0x53
github.com/Code-Hex/go-generics-cache/policy/lfu.(*Cache[...]).Delete(0xc0006982d0, {0xc000322181, 0xbf})
github.com/Code-Hex/[email protected]/policy/lfu/lfu.go:92 +0x65
github.com/Code-Hex/go-generics-cache.(*Cache[...]).DeleteExpired(0xc0002c2a20)
github.com/Code-Hex/[email protected]/cache.go:209 +0x158
github.com/Code-Hex/go-generics-cache.NewContext[...].func1()
github.com/Code-Hex/[email protected]/cache.go:175 +0x25
github.com/Code-Hex/go-generics-cache.(*janitor).run.func1()
github.com/Code-Hex/[email protected]/janitor.go:39 +0x122
created by github.com/Code-Hex/go-generics-cache.(*janitor).run
github.com/Code-Hex/[email protected]/janitor.go:33 +0x72
Metadata
Metadata
Assignees
Labels
No labels