finalizer bug, ignoring gc for now

add-license-1 v0.0.6
Basit Ali 2022-04-06 16:10:11 +05:00
parent 3e79112696
commit f68be2a82a
1 changed files with 1 additions and 2 deletions

View File

@ -1,7 +1,6 @@
package gocache package gocache
import ( import (
"runtime"
"sync" "sync"
"time" "time"
) )
@ -31,7 +30,7 @@ func NewCacheWithSweeper(interval, expireAfter time.Duration,
if interval > 0 && expireAfter > 0 { if interval > 0 && expireAfter > 0 {
s := newSweeper(c, interval) s := newSweeper(c, interval)
runtime.SetFinalizer(c, s.stopSweeper) // runtime.SetFinalizer(c, s.stopSweeper)
go s.run(c) go s.run(c)
} }