We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 971790b commit aca3e78Copy full SHA for aca3e78
1 file changed
internal/cache.go
@@ -28,7 +28,7 @@ type Entry struct {
28
// start/stop timer added for safety to prevent fire on expired callback,
29
// when entry re-stored at the expiry time.
30
func (e *Entry) startTimer(d time.Duration, f func(key, value interface{})) {
31
- e.stopTimer() // Stop old timer if there
+ e.cancel = make(chan struct{})
32
e.timer = time.AfterFunc(d, func() {
33
select {
34
case <-e.cancel:
0 commit comments