|
|
@ -17,12 +17,18 @@ package rpccache
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"context"
|
|
|
|
"encoding/json"
|
|
|
|
"encoding/json"
|
|
|
|
|
|
|
|
"github.com/openimsdk/tools/mw"
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/openimsdk/tools/log"
|
|
|
|
"github.com/openimsdk/tools/log"
|
|
|
|
"github.com/redis/go-redis/v9"
|
|
|
|
"github.com/redis/go-redis/v9"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
func subscriberRedisDeleteCache(ctx context.Context, client redis.UniversalClient, channel string, del func(ctx context.Context, key ...string)) {
|
|
|
|
func subscriberRedisDeleteCache(ctx context.Context, client redis.UniversalClient, channel string, del func(ctx context.Context, key ...string)) {
|
|
|
|
|
|
|
|
defer func() {
|
|
|
|
|
|
|
|
if r := recover(); r != nil {
|
|
|
|
|
|
|
|
mw.PanicStackToLog(ctx, r)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}()
|
|
|
|
for message := range client.Subscribe(ctx, channel).Channel() {
|
|
|
|
for message := range client.Subscribe(ctx, channel).Channel() {
|
|
|
|
log.ZDebug(ctx, "subscriberRedisDeleteCache", "channel", channel, "payload", message.Payload)
|
|
|
|
log.ZDebug(ctx, "subscriberRedisDeleteCache", "channel", channel, "payload", message.Payload)
|
|
|
|
var keys []string
|
|
|
|
var keys []string
|
|
|
|