|
|
@ -47,6 +47,7 @@ type metaCache interface {
|
|
|
|
GetPreDelKeys() []string
|
|
|
|
GetPreDelKeys() []string
|
|
|
|
SetTopic(topic string)
|
|
|
|
SetTopic(topic string)
|
|
|
|
SetRawRedisClient(cli redis.UniversalClient)
|
|
|
|
SetRawRedisClient(cli redis.UniversalClient)
|
|
|
|
|
|
|
|
Copy() metaCache
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func NewMetaCacheRedis(rcClient *rockscache.Client, keys ...string) metaCache {
|
|
|
|
func NewMetaCacheRedis(rcClient *rockscache.Client, keys ...string) metaCache {
|
|
|
@ -62,6 +63,22 @@ type metaCacheRedis struct {
|
|
|
|
redisClient redis.UniversalClient
|
|
|
|
redisClient redis.UniversalClient
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func (m *metaCacheRedis) Copy() metaCache {
|
|
|
|
|
|
|
|
var keys []string
|
|
|
|
|
|
|
|
if len(m.keys) > 0 {
|
|
|
|
|
|
|
|
keys = make([]string, 0, len(m.keys)*2)
|
|
|
|
|
|
|
|
keys = append(keys, m.keys...)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return &metaCacheRedis{
|
|
|
|
|
|
|
|
topic: m.topic,
|
|
|
|
|
|
|
|
rcClient: m.rcClient,
|
|
|
|
|
|
|
|
keys: keys,
|
|
|
|
|
|
|
|
maxRetryTimes: m.maxRetryTimes,
|
|
|
|
|
|
|
|
retryInterval: m.retryInterval,
|
|
|
|
|
|
|
|
redisClient: redisClient,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (m *metaCacheRedis) SetTopic(topic string) {
|
|
|
|
func (m *metaCacheRedis) SetTopic(topic string) {
|
|
|
|
m.topic = topic
|
|
|
|
m.topic = topic
|
|
|
|
}
|
|
|
|
}
|
|
|
|