Prevent download of NARs we just uploaded

This commit is contained in:
Eelco Dolstra
2016-02-26 15:21:44 +01:00
parent 02190b0fef
commit 6d741d2ffa
3 changed files with 9 additions and 4 deletions

View File

@ -116,11 +116,12 @@ static void copyClosureTo(ref<Store> destStore,
static void copyClosureFrom(ref<Store> destStore,
FdSource & from, FdSink & to, const PathSet & paths, counter & bytesReceived)
FdSource & from, FdSink & to, const PathSet & paths, counter & bytesReceived,
std::shared_ptr<FSAccessor> accessor)
{
to << cmdExportPaths << 0 << paths;
to.flush();
destStore->importPaths(false, from);
destStore->importPaths(false, from, accessor);
for (auto & p : paths)
bytesReceived += destStore->queryPathInfo(p).narSize;
@ -297,9 +298,11 @@ void State::buildRemote(ref<Store> destStore,
outputs.insert(output.second.path);
MaintainCount mc(nrStepsCopyingFrom);
result.accessor = destStore->getFSAccessor();
auto now1 = std::chrono::steady_clock::now();
copyClosureFrom(destStore, from, to, outputs, bytesReceived);
copyClosureFrom(destStore, from, to, outputs, bytesReceived, result.accessor);
auto now2 = std::chrono::steady_clock::now();