Skip to content

Commit

Permalink
fix: re-assign entries var in readStreams
Browse files Browse the repository at this point in the history
  • Loading branch information
mhughdo committed Aug 28, 2024
1 parent a01194b commit 5c907e8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pkg/command/xread.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,11 @@ func (x *XRead) readStreams(opts *XReadOptions) (map[string][]keyval.StreamEntry
var entries []keyval.StreamEntry
if lastID == "$" {
// Ignore this case as $ means only new entries
// entries = stream.Range(stream.LastID(), "+", 1)
} else if lastID == "+" {
entries = stream.Range(stream.LastID(), "+", 1)
entries = append(entries, stream.Range(stream.LastID(), "+", 1)...)
} else {
entries = stream.Range(lastID, "+", opts.Count)
entries = append(entries, stream.Range(lastID, "+", opts.Count)...)
}

if len(entries) > 0 {
result[streamName] = entries
hasData = true
Expand Down

0 comments on commit 5c907e8

Please sign in to comment.