From 14aba3bb8976f20651246fd49a0367e9e401ae41 Mon Sep 17 00:00:00 2001 From: withchao <993506633@qq.com> Date: Tue, 2 Jul 2024 16:26:24 +0800 Subject: [PATCH] online cache --- pkg/rpccache/online.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pkg/rpccache/online.go b/pkg/rpccache/online.go index 5072984b0..5bacd647d 100644 --- a/pkg/rpccache/online.go +++ b/pkg/rpccache/online.go @@ -64,10 +64,6 @@ type OnlineCache struct { local lru.LRU[string, []int32] } -func (o *OnlineCache) getUserOnlineKey(userID string) string { - return "" + userID -} - func (o *OnlineCache) GetUserOnlinePlatform(ctx context.Context, userID string) ([]int32, error) { return o.local.Get(userID, func() ([]int32, error) { return o.user.GetUserOnlinePlatform(ctx, userID) @@ -117,5 +113,5 @@ func (o *OnlineCache) GetGroupOnline(ctx context.Context, groupID string) ([]str } func (o *OnlineCache) setUserOnline(userID string, platformIDs []int32) bool { - return o.local.SetHas(o.getUserOnlineKey(userID), platformIDs) + return o.local.SetHas(userID, platformIDs) }