MCPcopy
hub / github.com/grafana/dskit / FlushAll

Method FlushAll

cache/memcached_client.go:578–599  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

576}
577
578func (c *MemcachedClient) FlushAll(ctx context.Context) error {
579 var err error
580 start := time.Now()
581 c.metrics.operations.WithLabelValues(opFlush).Inc()
582
583 select {
584 case <-ctx.Done():
585 err = ctx.Err()
586 default:
587 err = c.client.FlushAll()
588 }
589 if err != nil {
590 c.trackError(
591 opFlush, err,
592 "msg", "failed to flush all cache",
593 )
594 } else {
595 c.metrics.duration.WithLabelValues(opFlush).Observe(time.Since(start).Seconds())
596 }
597
598 return err
599}
600
601func (c *MemcachedClient) storeOperation(ctx context.Context, key string, value []byte, ttl time.Duration, operation string, f func(ctx context.Context, key string, value []byte, ttl time.Duration) error) error {
602 if !c.itemSizeIsAcceptable(key, value, operation) {

Callers

nothing calls this directly

Calls 4

trackErrorMethod · 0.95
DoneMethod · 0.65
FlushAllMethod · 0.65
ErrMethod · 0.45

Tested by

no test coverage detected