chore: add tests (#2960)

This commit is contained in:
Kevin Wan
2023-03-04 20:34:15 +08:00
committed by kevin
parent af50a80d01
commit 9e0e01b2bc
2 changed files with 31 additions and 1 deletions

View File

@@ -277,5 +277,6 @@ func (c cacheNode) processCache(ctx context.Context, key, data string, v interfa
func (c cacheNode) setCacheWithNotFound(ctx context.Context, key string) error {
seconds := int(math.Ceil(c.aroundDuration(c.notFoundExpiry).Seconds()))
return c.rds.SetexCtx(ctx, key, notFoundPlaceholder, seconds)
_, err := c.rds.SetnxExCtx(ctx, key, notFoundPlaceholder, seconds)
return err
}