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

Method BatchAdd

internal/routing/aggregator.go:313–335  ·  view source on GitHub ↗
(results map[string]AggregatorResErr)

Source from the content-addressed store, hash-verified

311}
312
313func (a *AggMinAggregator) BatchAdd(results map[string]AggregatorResErr) error {
314 min := int64(math.MaxInt64)
315
316 for _, res := range results {
317 if res.Err != nil {
318 _ = a.Add(nil, res.Err)
319 return nil
320 }
321
322 resInt, err := toInt64(res.Result)
323 if err != nil {
324 _ = a.Add(nil, res.Err)
325 return nil
326 }
327
328 if resInt < min {
329 min = resInt
330 }
331
332 }
333
334 return a.Add(min, nil)
335}
336
337func (a *AggMinAggregator) AddWithKey(key string, result interface{}, err error) error {
338 return a.Add(result, err)

Callers

nothing calls this directly

Calls 2

AddMethod · 0.95
toInt64Function · 0.70

Tested by

no test coverage detected