1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 06:31:14 +02:00

Make 'nix copy' to file:// binary caches run in constant memory

This commit is contained in:
Eelco Dolstra 2020-07-10 20:58:02 +02:00
parent 400f1a9b59
commit fc84c358d9
9 changed files with 120 additions and 87 deletions

View file

@ -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"))