mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-10-26 21:22:16 +08:00
Merge branch 'test-ci' of github.com:mo3et/open-im-server into test-ci
This commit is contained in:
commit
f206e8e27a
@ -60,16 +60,15 @@ func (a *authDatabase) BatchSetTokenMapByUidPid(ctx context.Context, tokens []st
|
|||||||
setMap := make(map[string]map[string]any)
|
setMap := make(map[string]map[string]any)
|
||||||
for _, token := range tokens {
|
for _, token := range tokens {
|
||||||
claims, err := tokenverify.GetClaimFromToken(token, authverify.Secret(a.accessSecret))
|
claims, err := tokenverify.GetClaimFromToken(token, authverify.Secret(a.accessSecret))
|
||||||
key := cachekey.GetTokenKey(claims.UserID, claims.PlatformID)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
|
}
|
||||||
|
key := cachekey.GetTokenKey(claims.UserID, claims.PlatformID)
|
||||||
|
if v, ok := setMap[key]; ok {
|
||||||
|
v[token] = constant.KickedToken
|
||||||
} else {
|
} else {
|
||||||
if v, ok := setMap[key]; ok {
|
setMap[key] = map[string]any{
|
||||||
v[token] = constant.KickedToken
|
token: constant.KickedToken,
|
||||||
} else {
|
|
||||||
setMap[key] = map[string]any{
|
|
||||||
token: constant.KickedToken,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,11 +18,12 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"github.com/openimsdk/tools/utils/jsonutil"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/openimsdk/tools/utils/jsonutil"
|
||||||
|
|
||||||
"github.com/openimsdk/open-im-server/v3/pkg/common/storage/database"
|
"github.com/openimsdk/open-im-server/v3/pkg/common/storage/database"
|
||||||
"github.com/openimsdk/open-im-server/v3/pkg/common/storage/model"
|
"github.com/openimsdk/open-im-server/v3/pkg/common/storage/model"
|
||||||
|
|
||||||
@ -722,13 +723,13 @@ func (db *commonMsgDatabase) DeleteDoc(ctx context.Context, docID string) error
|
|||||||
if index <= 0 {
|
if index <= 0 {
|
||||||
return errs.ErrInternalServer.WrapMsg("docID is invalid", "docID", docID)
|
return errs.ErrInternalServer.WrapMsg("docID is invalid", "docID", docID)
|
||||||
}
|
}
|
||||||
index, err := strconv.Atoi(docID[index+1:])
|
docIndex, err := strconv.Atoi(docID[index+1:])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errs.WrapMsg(err, "strconv.Atoi", "docID", docID)
|
return errs.WrapMsg(err, "strconv.Atoi", "docID", docID)
|
||||||
}
|
}
|
||||||
conversationID := docID[:index]
|
conversationID := docID[:index]
|
||||||
seqs := make([]int64, db.msgTable.GetSingleGocMsgNum())
|
seqs := make([]int64, db.msgTable.GetSingleGocMsgNum())
|
||||||
minSeq := db.msgTable.GetMinSeq(index)
|
minSeq := db.msgTable.GetMinSeq(docIndex)
|
||||||
for i := range seqs {
|
for i := range seqs {
|
||||||
seqs[i] = minSeq + int64(i)
|
seqs[i] = minSeq + int64(i)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user