libstore: asyncify Store::setOptions

Change-Id: I80d45ccdd027663a2b7c32f21a9a78fda6906044
This commit is contained in:
eldritch horrors
2025-03-05 16:42:11 +01:00
parent 4cd14a30bc
commit adf33551e4
4 changed files with 8 additions and 5 deletions
+1 -1
View File
@@ -392,7 +392,7 @@ LockedFlake lockFlake(
if (lockFlags.applyNixConfig) {
flake.config.apply();
state.ctx.store->setOptions();
state.aio.blockOn(state.ctx.store->setOptions());
}
try {
+5 -2
View File
@@ -194,9 +194,12 @@ RemoteStore::ConnectionHandle RemoteStore::getConnection()
return ConnectionHandle(connections->get());
}
void RemoteStore::setOptions()
{
kj::Promise<Result<void>> RemoteStore::setOptions()
try {
setOptions(*(getConnection().handle));
co_return result::success();
} catch (...) {
co_return result::current_exception();
}
bool RemoteStore::isValidPathUncached(const StorePath & path)
+1 -1
View File
@@ -185,7 +185,7 @@ protected:
virtual void setOptions(Connection & conn);
void setOptions() override;
kj::Promise<Result<void>> setOptions() override;
struct ConnectionHandle;
+1 -1
View File
@@ -897,7 +897,7 @@ public:
* Synchronises the options of the client with those of the daemon
* (a no-op when theres no daemon)
*/
virtual void setOptions() { }
virtual kj::Promise<Result<void>> setOptions() { return {result::success()}; }
virtual std::optional<std::string> getVersion() { return {}; }