From c13571015a04255138be3e9720935049568ef682 Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Fri, 6 Jun 2025 18:09:46 +0200 Subject: [PATCH] libstore: send worker options packet as one blob mostly to make moving this to async writes easier. this won't have a performance impact because it's only a single packet, that's written to a BufferedSink, but the connection sink only gets a single write. Change-Id: I9a5f1afe7d3e25f5f4502ef9520ff2f2529431ba --- lix/libstore/remote-store.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lix/libstore/remote-store.cc b/lix/libstore/remote-store.cc index 365729226..f0c7e1362 100644 --- a/lix/libstore/remote-store.cc +++ b/lix/libstore/remote-store.cc @@ -112,7 +112,9 @@ void RemoteStore::initConnection(Connection & conn) void RemoteStore::setOptions(Connection & conn) { - conn.to << WorkerProto::Op::SetOptions + StringSink command; + + command << WorkerProto::Op::SetOptions << settings.keepFailed << settings.keepGoing << settings.tryFallback @@ -141,10 +143,11 @@ void RemoteStore::setOptions(Connection & conn) overrides.erase(settings.pluginFiles.name); overrides.erase(settings.storeUri.name); // the daemon *is* the store overrides.erase(settings.tarballTtl.name); // eval-time only, implictly set by flake cli - conn.to << overrides.size(); + command << overrides.size(); for (auto & i : overrides) - conn.to << i.first << i.second.value; + command << i.first << i.second.value; + StringSource{command.s}.drainInto(conn.to); auto ex = conn.processStderr(); if (ex) std::rethrow_exception(ex); }