Check for cancellation on every step of a range evaluation

Signed-off-by: Bryan Boreham <bryan@weave.works>
pull/5449/head
Bryan Boreham 6 years ago committed by Brian Brazil
parent e4a37d0986
commit 69dd090880

@ -791,6 +791,9 @@ func (ev *evaluator) rangeEval(f func([]Value, *EvalNodeHelper) Vector, exprs ..
seriess := make(map[uint64]Series, biggestLen) // Output series by series hash.
tempNumSamples := ev.currentSamples
for ts := ev.startTimestamp; ts <= ev.endTimestamp; ts += ev.interval {
if err := contextDone(ev.ctx, "expression evaluation"); err != nil {
ev.error(err)
}
// Reset number of samples in memory after each timestamp.
ev.currentSamples = tempNumSamples
// Gather input vectors for this timestamp.

Loading…
Cancel
Save