Merge remote-tracking branch 'origin/v2.3.0release' into v2.3.0release

This commit is contained in:
Gordon 2022-08-15 11:17:12 +08:00
commit 652d560a21
6 changed files with 15 additions and 11 deletions

View File

@ -41,7 +41,7 @@ func main() {
gin.SetMode(gin.ReleaseMode) gin.SetMode(gin.ReleaseMode)
f, _ := os.Create("../logs/api.log") f, _ := os.Create("../logs/api.log")
gin.DefaultWriter = io.MultiWriter(f) gin.DefaultWriter = io.MultiWriter(f)
gin.SetMode(gin.DebugMode) // gin.SetMode(gin.DebugMode)
r := gin.Default() r := gin.Default()
r.Use(utils.CorsHandler()) r.Use(utils.CorsHandler())

View File

@ -12,9 +12,10 @@ import (
"bytes" "bytes"
"context" "context"
"encoding/gob" "encoding/gob"
"strings"
go_redis "github.com/go-redis/redis/v8" go_redis "github.com/go-redis/redis/v8"
"github.com/pkg/errors" "github.com/pkg/errors"
"strings"
//"gopkg.in/errgo.v2/errors" //"gopkg.in/errgo.v2/errors"
"net/http" "net/http"
@ -133,6 +134,7 @@ func (ws *WServer) MultiTerminalLoginRemoteChecker(userID string, platformID int
resp, err := client.MultiTerminalLoginCheck(context.Background(), req) resp, err := client.MultiTerminalLoginCheck(context.Background(), req)
if err != nil { if err != nil {
log.Error(operationID, "MultiTerminalLoginCheck failed ", err.Error()) log.Error(operationID, "MultiTerminalLoginCheck failed ", err.Error())
continue
} }
if resp.ErrCode != 0 { if resp.ErrCode != 0 {
log.Error(operationID, "MultiTerminalLoginCheck errCode, errMsg: ", resp.ErrCode, resp.ErrMsg) log.Error(operationID, "MultiTerminalLoginCheck errCode, errMsg: ", resp.ErrCode, resp.ErrMsg)
@ -237,7 +239,7 @@ func (ws *WServer) MultiTerminalLoginChecker(uid string, platformID int, newConn
log.NewError(operationID, utils.GetSelfFuncName(), "callbackUserOffline failed", callbackResp) log.NewError(operationID, utils.GetSelfFuncName(), "callbackUserOffline failed", callbackResp)
} }
} else { } else {
log.NewWarn(operationID, "normal uid-conn ", uid, platformID, oldConnMap[platformID]) log.Debug(operationID, "normal uid-conn ", uid, platformID, oldConnMap[platformID])
} }
} else { } else {

View File

@ -407,7 +407,7 @@ func (och *OnlineHistoryRedisConsumerHandler) ConsumeClaim(sess sarama.ConsumerG
rwLock.Unlock() rwLock.Unlock()
split := 1000 split := 1000
triggerID = utils.OperationIDGenerator() triggerID = utils.OperationIDGenerator()
log.NewWarn(triggerID, "timer trigger msg consumer start", len(ccMsg)) log.Debug(triggerID, "timer trigger msg consumer start", len(ccMsg))
for i := 0; i < len(ccMsg)/split; i++ { for i := 0; i < len(ccMsg)/split; i++ {
//log.Debug() //log.Debug()
och.msgDistributionCh <- Cmd2Value{Cmd: ConsumerMsgs, Value: TriggerChannelValue{ och.msgDistributionCh <- Cmd2Value{Cmd: ConsumerMsgs, Value: TriggerChannelValue{
@ -419,9 +419,8 @@ func (och *OnlineHistoryRedisConsumerHandler) ConsumeClaim(sess sarama.ConsumerG
} }
//sess.MarkMessage(ccMsg[len(cMsg)-1], "") //sess.MarkMessage(ccMsg[len(cMsg)-1], "")
log.NewWarn(triggerID, "timer trigger msg consumer end", len(cMsg)) log.Debug(triggerID, "timer trigger msg consumer end", len(cMsg))
} }
} }
} }

View File

@ -203,7 +203,7 @@ type SetGroupInfoReq struct {
FaceURL string `json:"faceURL"` FaceURL string `json:"faceURL"`
Ex string `json:"ex"` Ex string `json:"ex"`
OperationID string `json:"operationID" binding:"required"` OperationID string `json:"operationID" binding:"required"`
NeedVerification *int32 `json:"needVerification" ` NeedVerification *int32 `json:"needVerification"`
LookMemberInfo *int32 `json:"lookMemberInfo"` LookMemberInfo *int32 `json:"lookMemberInfo"`
ApplyMemberFriend *int32 `json:"applyMemberFriend"` ApplyMemberFriend *int32 `json:"applyMemberFriend"`
} }

View File

@ -185,14 +185,14 @@ func (d *DataBases) GetMessageListBySeq(userID string, seqList []uint32, operati
if err != nil { if err != nil {
errResult = err errResult = err
failedSeqList = append(failedSeqList, v) failedSeqList = append(failedSeqList, v)
log2.NewWarn(operationID, "redis get message error:", err.Error(), v) log2.Debug(operationID, "redis get message error: ", err.Error(), v)
} else { } else {
msg := pbCommon.MsgData{} msg := pbCommon.MsgData{}
err = jsonpb.UnmarshalString(result, &msg) err = jsonpb.UnmarshalString(result, &msg)
if err != nil { if err != nil {
errResult = err errResult = err
failedSeqList = append(failedSeqList, v) failedSeqList = append(failedSeqList, v)
log2.NewWarn(operationID, "Unmarshal err", result, err.Error()) log2.NewWarn(operationID, "Unmarshal err ", result, err.Error())
} else { } else {
log2.NewDebug(operationID, "redis get msg is ", msg.String()) log2.NewDebug(operationID, "redis get msg is ", msg.String())
seqMsg = append(seqMsg, &msg) seqMsg = append(seqMsg, &msg)

View File

@ -6,9 +6,10 @@ import (
commonDB "Open_IM/pkg/common/db" commonDB "Open_IM/pkg/common/db"
"Open_IM/pkg/common/log" "Open_IM/pkg/common/log"
"Open_IM/pkg/utils" "Open_IM/pkg/utils"
"time"
go_redis "github.com/go-redis/redis/v8" go_redis "github.com/go-redis/redis/v8"
"github.com/golang-jwt/jwt/v4" "github.com/golang-jwt/jwt/v4"
"time"
) )
//var ( //var (
@ -103,7 +104,9 @@ func GetClaimFromToken(tokensString string) (*Claims, error) {
} else if ve.Errors&jwt.ValidationErrorExpired != 0 { } else if ve.Errors&jwt.ValidationErrorExpired != 0 {
return nil, constant.ErrTokenExpired return nil, constant.ErrTokenExpired
} else if ve.Errors&jwt.ValidationErrorNotValidYet != 0 { } else if ve.Errors&jwt.ValidationErrorNotValidYet != 0 {
return nil, constant.ErrTokenNotValidYet log.Error("", "ParseToken failed, ", err.Error(), token)
return nil, nil
// return nil, constant.ErrTokenNotValidYet
} else { } else {
return nil, constant.ErrTokenUnknown return nil, constant.ErrTokenUnknown
} }