aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/s3-binary-cache-store.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-07-10 20:58:02 +0200
committerEelco Dolstra <edolstra@gmail.com>2020-07-13 16:28:45 +0200
commitfc84c358d9e55e9ba1d939d8974f6deef629848e (patch)
treec51ed8a28bef915c55fb79e8fe61adbd553313b2 /src/libstore/s3-binary-cache-store.cc
parent400f1a9b59d95861b4dd171c45e2dc6cf263ab99 (diff)
Make 'nix copy' to file:// binary caches run in constant memory
Diffstat (limited to 'src/libstore/s3-binary-cache-store.cc')
-rw-r--r--src/libstore/s3-binary-cache-store.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libstore/s3-binary-cache-store.cc b/src/libstore/s3-binary-cache-store.cc
index f85563766..57f16101d 100644
--- a/src/libstore/s3-binary-cache-store.cc
+++ b/src/libstore/s3-binary-cache-store.cc
@@ -355,9 +355,10 @@ struct S3BinaryCacheStoreImpl : public S3BinaryCacheStore
stats.put++;
}
- void upsertFile(const std::string & path, const std::string & data,
+ void upsertFile(const std::string & path, Source & source,
const std::string & mimeType) override
{
+ auto data = source.drain();
if (narinfoCompression != "" && hasSuffix(path, ".narinfo"))
uploadFile(path, *compress(narinfoCompression, data), mimeType, narinfoCompression);
else if (lsCompression != "" && hasSuffix(path, ".ls"))