fix: handle backend issue list regressions

This commit is contained in:
richjohnrambo
2026-09-30 15:35:03 +08:00
parent 7685fb0c02
commit 99ae6328ff
8 changed files with 207 additions and 5 deletions
+19 -1
View File
@@ -1411,7 +1411,8 @@ func (r *redisGroupMessageRuntime) hotSeqIDs(tenantID types.TenantID, topic stri
if err != nil {
return nil, false, err
}
if len(raw) < limit {
expected := hotSeqExpectedCount(opts, limit)
if len(raw) < expected {
return nil, false, nil
}
seqs := make([]int64, 0, len(raw))
@@ -1425,6 +1426,23 @@ func (r *redisGroupMessageRuntime) hotSeqIDs(tenantID types.TenantID, topic stri
return seqs, true, nil
}
func hotSeqExpectedCount(opts *types.QueryOpt, limit int) int {
if limit <= 0 {
return 0
}
if opts == nil || opts.Since <= 0 || opts.Before <= opts.Since {
return limit
}
expected := opts.Before - opts.Since
if expected <= 0 {
return limit
}
if expected > int64(limit) {
return limit
}
return int(expected)
}
func expandRanges(ranges []types.Range, limit int) []int64 {
if limit <= 0 {
return nil