Skip to content

Commit

Permalink
fix:get max seqs
Browse files Browse the repository at this point in the history
  • Loading branch information
icey-yu committed Jul 3, 2024
1 parent 0f2acd1 commit b8ff6ba
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/common/storage/cache/redis/seq.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,12 @@ func (c *seqCache) getSeq(ctx context.Context, conversationID string, getkey fun

func (c *seqCache) getSeqs(ctx context.Context, items []string, getkey func(s string) string) (m map[string]int64, err error) {
m = make(map[string]int64, len(items))
reverseMap := make(map[string]string, len(items))
var lock sync.Mutex
var (
reverseMap = make(map[string]string, len(items))
keys = make([]string, len(items))
lock sync.Mutex
)

keys := make([]string, len(items))
for i, v := range items {
keys[i] = getkey(v)
reverseMap[getkey(v)] = v
Expand Down

0 comments on commit b8ff6ba

Please sign in to comment.