forked from p93542168/wheat-cache
perf(lru): add the sync.Once to define
This commit is contained in:
parent
75e1251d22
commit
71ddeb4772
|
@ -1,10 +1,16 @@
|
||||||
package lru
|
package lru
|
||||||
|
|
||||||
|
import "sync"
|
||||||
|
|
||||||
type SingleWorkFunc func() interface{}
|
type SingleWorkFunc func() interface{}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
OpEventName = "operateEvent"
|
OpEventName = "operateEvent"
|
||||||
CleEventName = "clearEvent"
|
CleEventName = "clearEvent"
|
||||||
|
WorkFuncEventKey = "workFunc"
|
||||||
WorkFuncEventCtxKey = "workFunc"
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
lruCacheOnce sync.Once
|
||||||
|
lruCache *singleCache
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue