perf(lru): add the sync.Once to define

This commit is contained in:
HuangJiaLuo 2021-10-04 16:25:09 +08:00
parent 75e1251d22
commit 71ddeb4772
1 changed files with 8 additions and 2 deletions

View File

@ -1,10 +1,16 @@
package lru
import "sync"
type SingleWorkFunc func() interface{}
const (
OpEventName = "operateEvent"
CleEventName = "clearEvent"
WorkFuncEventCtxKey = "workFunc"
WorkFuncEventKey = "workFunc"
)
var (
lruCacheOnce sync.Once
lruCache *singleCache
)