diff --git a/service/main/game_mgr/handler_http.go b/service/main/game_mgr/handler_http.go index 15b183f..671750a 100644 --- a/service/main/game_mgr/handler_http.go +++ b/service/main/game_mgr/handler_http.go @@ -144,6 +144,7 @@ func OnDataPush(c *gin.Context) { } for _, notify := range notifyData { redis.Publish(appId, roomId, notify) + fmt.Println("[Publish]", appId, roomId) } } diff --git a/service/main/redis/redis.go b/service/main/redis/redis.go index 0ed7a79..db1d2e8 100644 --- a/service/main/redis/redis.go +++ b/service/main/redis/redis.go @@ -92,6 +92,7 @@ func Subscribe(appId string, roomId string, pushFunc func(string), pushCloseChan go func() { for { msg, err := ps.ReceiveMessage(context.Background()) + fmt.Println("ReceiveMessage", msg, err) if err != nil { return } diff --git a/service/main/user/user.go b/service/main/user/user.go index a714770..6de0648 100644 --- a/service/main/user/user.go +++ b/service/main/user/user.go @@ -191,6 +191,8 @@ func (s *User) OnGetRank(msg *pb.GetRank) { func (s *User) setPushActive(isActive bool) { if isActive { + s.Log("SetPushActive1", s.appId) + s.Log("SetPushActive2", s.roomId) redis.Subscribe(s.appId, s.roomId, s.OnRecvPush, s.pushCloseChan) if !s.isDebug { s.mgr.StartTask(s.appId, s.roomId, "1")