Skip to content

Commit 241ab71

Browse files
authored
Merge pull request #1536 from NixOS/fix-1535
Revert "Deduplicate protocol code more with `ServeProto::BasicClientConnection`
2 parents 78ed8d7 + 4bd941d commit 241ab71

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/hydra-queue-runner/build-remote.cc

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ static void copyClosureTo(
104104
std::unique_lock<std::timed_mutex> sendLock(conn.machine->state->sendLock,
105105
std::chrono::seconds(600));
106106

107-
conn.importPaths(destStore, [&](Sink & sink) {
108-
exportPaths(destStore, missing, sink);
109-
});
107+
conn.to << ServeProto::Command::ImportPaths;
108+
exportPaths(destStore, missing, conn.to);
109+
conn.to.flush();
110110

111111
if (readInt(conn.from) != 1)
112112
throw Error("remote machine failed to import closure");
@@ -301,10 +301,11 @@ static void copyPathFromRemote(
301301
lambda function only gets executed if someone tries to read
302302
from source2, we will send the command from here rather
303303
than outside the lambda. */
304-
conn.narFromPath(localStore, info.path, [&](Source & source) {
305-
TeeSource tee(source, sink);
306-
extractNarData(tee, localStore.printStorePath(info.path), narMembers);
307-
});
304+
conn.to << ServeProto::Command::DumpStorePath << localStore.printStorePath(info.path);
305+
conn.to.flush();
306+
307+
TeeSource tee(conn.from, sink);
308+
extractNarData(tee, localStore.printStorePath(info.path), narMembers);
308309
});
309310

310311
destStore.addToStore(info, *source2, NoRepair, NoCheckSigs);

0 commit comments

Comments
 (0)