From 20d8eed400ac4a83260c84a0621235c537fbff59 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Mon, 22 Apr 2024 21:12:20 +0200 Subject: [PATCH] repository: streamPack: separate requests for gap larger than 1MB With most cloud providers, traffic is much more expensive than API calls. Thus slightly bias streamPack towards a bit more API calls in exchange for slightly less traffic. --- internal/repository/repository.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/repository/repository.go b/internal/repository/repository.go index 3ed9f7afa..84bac9ee3 100644 --- a/internal/repository/repository.go +++ b/internal/repository/repository.go @@ -941,8 +941,8 @@ func (r *Repository) SaveBlob(ctx context.Context, t restic.BlobType, buf []byte type backendLoadFn func(ctx context.Context, h backend.Handle, length int, offset int64, fn func(rd io.Reader) error) error type loadBlobFn func(ctx context.Context, t restic.BlobType, id restic.ID, buf []byte) ([]byte, error) -// Skip sections with more than 4MB unused blobs -const maxUnusedRange = 4 * 1024 * 1024 +// Skip sections with more than 1MB unused blobs +const maxUnusedRange = 1 * 1024 * 1024 // LoadBlobsFromPack loads the listed blobs from the specified pack file. The plaintext blob is passed to // the handleBlobFn callback or an error if decryption failed or the blob hash does not match.