MCPcopy
hub / github.com/redis/go-redis / BatchSlice

Method BatchSlice

internal/routing/aggregator.go:429–451  ·  view source on GitHub ↗
(results []AggregatorResErr)

Source from the content-addressed store, hash-verified

427}
428
429func (a *AggMaxAggregator) BatchSlice(results []AggregatorResErr) error {
430 max := int64(math.MinInt64)
431
432 for _, res := range results {
433 if res.Err != nil {
434 _ = a.Add(nil, res.Err)
435 return nil
436 }
437
438 resInt, err := toInt64(res.Result)
439 if err != nil {
440 _ = a.Add(nil, res.Err)
441 return nil
442 }
443
444 if resInt > max {
445 max = resInt
446 }
447
448 }
449
450 return a.Add(max, nil)
451}
452
453func (a *AggMaxAggregator) Result() (interface{}, error) {
454 err := a.err.Load()

Callers

nothing calls this directly

Calls 2

AddMethod · 0.95
toInt64Function · 0.70

Tested by

no test coverage detected