MCPcopy Create free account
hub / github.com/go-dev-frame/sponge / SetCacheWithNotFound

Method SetCacheWithNotFound

pkg/cache/redis.go:392–399  ·  view source on GitHub ↗

SetCacheWithNotFound set value for notfound

(ctx context.Context, key string)

Source from the content-addressed store, hash-verified

390
391// SetCacheWithNotFound set value for notfound
392func (c *redisClusterCache) SetCacheWithNotFound(ctx context.Context, key string) error {
393 cacheKey, err := BuildCacheKey(c.KeyPrefix, key)
394 if err != nil {
395 return fmt.Errorf("BuildCacheKey error: %v, key=%s", err, key)
396 }
397
398 return c.client.Set(ctx, cacheKey, NotFoundPlaceholder, DefaultNotFoundExpireTime).Err()
399}

Callers

nothing calls this directly

Calls 4

BuildCacheKeyFunction · 0.85
ErrorfMethod · 0.80
SetMethod · 0.65
ErrMethod · 0.45

Tested by

no test coverage detected