Skip to content

Commit

Permalink
Implement Err() for taskMergeIterator
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
  • Loading branch information
chaudum committed Nov 9, 2023
1 parent e1d800e commit ea6b324
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/bloomgateway/multiplexing.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package bloomgateway

import (
"errors"
"time"

"github.com/oklog/ulid"
Expand Down Expand Up @@ -71,6 +72,7 @@ type taskMergeIterator struct {
curr FilterRequest
heap *v1.HeapIterator[*logproto.GroupedChunkRefs]
tasks []Task
err error
}

func newTaskMergeIterator(tasks ...Task) *taskMergeIterator {
Expand All @@ -93,6 +95,7 @@ func (it *taskMergeIterator) init() {
},
sequences...,
)
it.err = nil
}

func (it *taskMergeIterator) Reset() {
Expand All @@ -107,6 +110,7 @@ func (it *taskMergeIterator) Next() bool {

currIter, ok := it.heap.CurrIter().(*SliceIterWithIndex[*logproto.GroupedChunkRefs])
if !ok {
it.err = errors.New("failed to cast iterator")
return false
}
iterIndex := currIter.Index()
Expand All @@ -127,5 +131,5 @@ func (it *taskMergeIterator) At() FilterRequest {
}

func (it *taskMergeIterator) Err() error {
return nil
return it.err
}

0 comments on commit ea6b324

Please sign in to comment.