|
|
|
@ -2,6 +2,7 @@ package rpccache
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
"github.com/OpenIMSDK/tools/log"
|
|
|
|
|
"github.com/openimsdk/localcache"
|
|
|
|
|
"github.com/openimsdk/open-im-server/v3/pkg/common/cachekey"
|
|
|
|
|
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
|
|
|
|
@ -27,8 +28,17 @@ type ConversationLocalCache struct {
|
|
|
|
|
local localcache.Cache[any]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *ConversationLocalCache) GetConversationIDs(ctx context.Context, ownerUserID string) ([]string, error) {
|
|
|
|
|
func (c *ConversationLocalCache) GetConversationIDs(ctx context.Context, ownerUserID string) (val []string, err error) {
|
|
|
|
|
log.ZDebug(ctx, "ConversationLocalCache GetConversationIDs req", "ownerUserID", ownerUserID)
|
|
|
|
|
defer func() {
|
|
|
|
|
if err == nil {
|
|
|
|
|
log.ZDebug(ctx, "ConversationLocalCache GetConversationIDs return", "value", val)
|
|
|
|
|
} else {
|
|
|
|
|
log.ZError(ctx, "ConversationLocalCache GetConversationIDs return", err)
|
|
|
|
|
}
|
|
|
|
|
}()
|
|
|
|
|
return localcache.AnyValue[[]string](c.local.Get(ctx, cachekey.GetConversationIDsKey(ownerUserID), func(ctx context.Context) (any, error) {
|
|
|
|
|
log.ZDebug(ctx, "ConversationLocalCache GetConversationIDs rpc", "ownerUserID", ownerUserID)
|
|
|
|
|
return c.client.GetConversationIDs(ctx, ownerUserID)
|
|
|
|
|
}))
|
|
|
|
|
}
|
|
|
|
|