Files
PandaX/pkg/cache/product_rule.go
❀ » Cato Sweeney. ❀ » Console@the.bb 9746ee63cd 切换kit包依赖为本库kit
2024-01-23 20:25:47 +08:00

21 lines
404 B
Go

package cache
import (
"pandax/kit/cache"
"time"
)
var ProductCache = cache.NewTimedCache(cache.NoExpiration, 24*time.Hour)
func ComputeIfAbsentProductRule(key string, fun func(any) (any, error)) (any, error) {
return ProductCache.ComputeIfAbsent(key, fun)
}
func DelProductRule(key string) {
ProductCache.Delete(key)
}
func PutProductRule(key string, data any) {
ProductCache.Put(key, data)
}