mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-23 10:58:35 +08:00
21 lines
404 B
Go
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)
|
|
}
|