libstore: asyncify Store::setOptions
Change-Id: I80d45ccdd027663a2b7c32f21a9a78fda6906044
This commit is contained in:
@@ -392,7 +392,7 @@ LockedFlake lockFlake(
|
||||
|
||||
if (lockFlags.applyNixConfig) {
|
||||
flake.config.apply();
|
||||
state.ctx.store->setOptions();
|
||||
state.aio.blockOn(state.ctx.store->setOptions());
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -185,7 +185,7 @@ protected:
|
||||
|
||||
virtual void setOptions(Connection & conn);
|
||||
|
||||
void setOptions() override;
|
||||
kj::Promise<Result<void>> setOptions() override;
|
||||
|
||||
struct ConnectionHandle;
|
||||
|
||||
|
||||
@@ -897,7 +897,7 @@ public:
|
||||
* Synchronises the options of the client with those of the daemon
|
||||
* (a no-op when there’s no daemon)
|
||||
*/
|
||||
virtual void setOptions() { }
|
||||
virtual kj::Promise<Result<void>> setOptions() { return {result::success()}; }
|
||||
|
||||
virtual std::optional<std::string> getVersion() { return {}; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user