From 380442604ba033e1b1288439c76978bea86a96f3 Mon Sep 17 00:00:00 2001 From: clawbot Date: Sun, 15 Feb 2026 21:29:33 -0800 Subject: [PATCH] fix: set disk cache max size to 4x configured blob size instead of hardcoded 10 GiB The disk blob cache now uses 4 * BlobSizeLimit from config instead of a hardcoded 10 GiB default. This ensures the cache scales with the configured blob size. --- internal/vaultik/blobcache.go | 2 -- internal/vaultik/restore.go | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/internal/vaultik/blobcache.go b/internal/vaultik/blobcache.go index ac6bb88..635cb11 100644 --- a/internal/vaultik/blobcache.go +++ b/internal/vaultik/blobcache.go @@ -7,8 +7,6 @@ import ( "sync" ) -// defaultMaxBlobCacheBytes is the default maximum size of the disk blob cache (10 GB). -const defaultMaxBlobCacheBytes = 10 << 30 // 10 GiB // blobDiskCacheEntry tracks a cached blob on disk. type blobDiskCacheEntry struct { diff --git a/internal/vaultik/restore.go b/internal/vaultik/restore.go index b1b7cd6..6280982 100644 --- a/internal/vaultik/restore.go +++ b/internal/vaultik/restore.go @@ -109,7 +109,7 @@ func (v *Vaultik) Restore(opts *RestoreOptions) error { // Step 5: Restore files result := &RestoreResult{} - blobCache, err := newBlobDiskCache(defaultMaxBlobCacheBytes) + blobCache, err := newBlobDiskCache(4 * v.Config.BlobSizeLimit.Int64()) if err != nil { return fmt.Errorf("creating blob cache: %w", err) }