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

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

This commit is contained in:
Eelco Dolstra 2020-07-13 20:07:19 +02:00
parent 493961b689
commit 7c2fef0a81
6 changed files with 57 additions and 27 deletions

View file

@ -100,11 +100,11 @@ protected:
}
void upsertFile(const std::string & path,
Source & source,
std::shared_ptr<std::basic_iostream<char>> istream,
const std::string & mimeType) override
{
auto req = FileTransferRequest(cacheUri + "/" + path);
req.data = std::make_shared<string>(source.drain());
req.data = std::make_shared<string>(StreamToSourceAdapter(istream).drain());
req.mimeType = mimeType;
try {
getFileTransfer()->upload(req);