Invalidate removes the entry for hash. Called on PAT revocation so the revoke takes effect immediately rather than waiting for the TTL.
(ctx context.Context, hash string)
| 99 | // Invalidate removes the entry for hash. Called on PAT revocation so the |
| 100 | // revoke takes effect immediately rather than waiting for the TTL. |
| 101 | func (c *PATCache) Invalidate(ctx context.Context, hash string) { |
| 102 | if c == nil { |
| 103 | return |
| 104 | } |
| 105 | if err := c.rdb.Del(ctx, patCacheKey(hash)).Err(); err != nil { |
| 106 | slog.Warn("pat_cache: invalidate failed; entry will expire on TTL", "error", err) |
| 107 | } |
| 108 | } |