From 7a35975ba146b570e90b11d8e079559dcb27837c Mon Sep 17 00:00:00 2001 From: icey-yu <1186114839@qq.com> Date: Fri, 6 Sep 2024 15:23:33 +0800 Subject: [PATCH] feat: add sleep in push --- pkg/rpccache/online.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/rpccache/online.go b/pkg/rpccache/online.go index 2d83cf2cc..730e158ce 100644 --- a/pkg/rpccache/online.go +++ b/pkg/rpccache/online.go @@ -86,6 +86,8 @@ func (o *OnlineCache) initUsersOnlineStatus(ctx context.Context) error { totalSet int ) + time.Sleep(time.Second * 10) + defer func(t time.Time) { log.ZWarn(ctx, "init users online status end", nil, "cost", time.Since(t), "totalSet", totalSet) }(time.Now()) @@ -186,7 +188,7 @@ func (o *OnlineCache) GetUsersOnline(ctx context.Context, userIDs []string) ([]s onlineUserIDs = make([]string, 0, len(userIDs)) offlineUserIDs = make([]string, 0, len(userIDs)) ) - // + //userOnlineMap, err := o.getUserOnlinePlatformBatch(ctx, userIDs) //if err != nil { // return nil, nil, err