diff --git a/physical/cache.go b/physical/cache.go index 31cd61da0..bca629036 100644 --- a/physical/cache.go +++ b/physical/cache.go @@ -33,6 +33,8 @@ type TransactionalCache struct { Transactional } +var _ Purgable = &Cache{} + // NewCache returns a physical cache of the given size. // If no size is provided, the default size is used. func NewCache(b Backend, size int, coreExceptions []string, logger log.Logger) *Cache { @@ -72,7 +74,7 @@ func NewTransactionalCache(b Backend, size int, coreExceptions []string, logger } // Purge is used to clear the cache -func (c *Cache) Purge() { +func (c *Cache) Purge(ctx context.Context) { // Lock the world for _, lock := range c.locks { lock.Lock() diff --git a/physical/inmem/cache_test.go b/physical/inmem/cache_test.go index 31b8b02cd..8ace7db35 100644 --- a/physical/inmem/cache_test.go +++ b/physical/inmem/cache_test.go @@ -52,7 +52,7 @@ func TestCache_Purge(t *testing.T) { } // Clear the cache - cache.Purge() + cache.Purge(context.Background()) // Read should fail out, err = cache.Get(context.Background(), "foo")