mirror of
https://github.com/distribution/distribution.git
synced 2025-09-05 00:41:19 +00:00
registry/storage/cache/memory: Use LRU cache to bound cache size
Instead of letting the cache grow without bound, use a LRU to impose a size limit. The limit is configurable through a new `blobdescriptorsize` config key. Signed-off-by: Aaron Lehmann <alehmann@netflix.com>
This commit is contained in:
@@ -25,7 +25,7 @@ func TestListener(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
registry, err := storage.NewRegistry(ctx, inmemory.New(), storage.BlobDescriptorCacheProvider(memory.NewInMemoryBlobDescriptorCacheProvider()), storage.EnableDelete, storage.EnableRedirect, storage.Schema1SigningKey(k), storage.EnableSchema1)
|
||||
registry, err := storage.NewRegistry(ctx, inmemory.New(), storage.BlobDescriptorCacheProvider(memory.NewInMemoryBlobDescriptorCacheProvider(memory.UnlimitedSize)), storage.EnableDelete, storage.EnableRedirect, storage.Schema1SigningKey(k), storage.EnableSchema1)
|
||||
if err != nil {
|
||||
t.Fatalf("error creating registry: %v", err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user