mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-28 04:48:44 +08:00
Merge remote-tracking branch 'origin/errcode' into errcode
This commit is contained in:
commit
3b56c41406
@ -483,6 +483,9 @@ func (db *commonMsgDatabase) GetMsgBySeqsRange(ctx context.Context, userID strin
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if len(seqs) == 0 {
|
||||||
|
return 0, 0, nil, nil
|
||||||
|
}
|
||||||
newBegin := seqs[0]
|
newBegin := seqs[0]
|
||||||
newEnd := seqs[len(seqs)-1]
|
newEnd := seqs[len(seqs)-1]
|
||||||
log.ZDebug(ctx, "GetMsgBySeqsRange", "first seqs", seqs, "newBegin", newBegin, "newEnd", newEnd)
|
log.ZDebug(ctx, "GetMsgBySeqsRange", "first seqs", seqs, "newBegin", newBegin, "newEnd", newEnd)
|
||||||
@ -519,7 +522,7 @@ func (db *commonMsgDatabase) GetMsgBySeqsRange(ctx context.Context, userID strin
|
|||||||
}
|
}
|
||||||
log.ZDebug(ctx, "get msgs from cache", "successMsgs", successMsgs)
|
log.ZDebug(ctx, "get msgs from cache", "successMsgs", successMsgs)
|
||||||
if len(failedSeqs) != 0 {
|
if len(failedSeqs) != 0 {
|
||||||
log.ZDebug(ctx, "msgs not exist in redis", err, "seqs", failedSeqs)
|
log.ZDebug(ctx, "msgs not exist in redis", "seqs", failedSeqs)
|
||||||
}
|
}
|
||||||
// get from cache or db
|
// get from cache or db
|
||||||
prome.Add(prome.MsgPullFromRedisSuccessCounter, len(successMsgs))
|
prome.Add(prome.MsgPullFromRedisSuccessCounter, len(successMsgs))
|
||||||
|
@ -2,7 +2,6 @@ package log
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
@ -119,14 +118,14 @@ func (l *ZapLogger) cores(isStdout bool, isJson bool, logLocation string, rotate
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
var cores []zapcore.Core
|
var cores []zapcore.Core
|
||||||
|
// if logLocation == "" && !isStdout {
|
||||||
|
// return nil, errors.New("log storage location is empty and not stdout")
|
||||||
|
// }
|
||||||
if logLocation != "" {
|
if logLocation != "" {
|
||||||
cores = []zapcore.Core{
|
cores = []zapcore.Core{
|
||||||
zapcore.NewCore(fileEncoder, writer, zap.NewAtomicLevelAt(l.level)),
|
zapcore.NewCore(fileEncoder, writer, zap.NewAtomicLevelAt(l.level)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if logLocation == "" && !isStdout {
|
|
||||||
return nil, errors.New("log storage location is empty and not stdout")
|
|
||||||
}
|
|
||||||
if isStdout {
|
if isStdout {
|
||||||
cores = append(cores, zapcore.NewCore(fileEncoder, zapcore.Lock(os.Stdout), zap.NewAtomicLevelAt(l.level)))
|
cores = append(cores, zapcore.NewCore(fileEncoder, zapcore.Lock(os.Stdout), zap.NewAtomicLevelAt(l.level)))
|
||||||
// cores = append(cores, zapcore.NewCore(fileEncoder, zapcore.Lock(os.Stderr), zap.NewAtomicLevelAt(l.level)))
|
// cores = append(cores, zapcore.NewCore(fileEncoder, zapcore.Lock(os.Stderr), zap.NewAtomicLevelAt(l.level)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user