diff options
Diffstat (limited to 'src/libstore/build/worker.cc')
-rw-r--r-- | src/libstore/build/worker.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/libstore/build/worker.cc b/src/libstore/build/worker.cc index 1cb4a6090..2a764b193 100644 --- a/src/libstore/build/worker.cc +++ b/src/libstore/build/worker.cc @@ -229,8 +229,8 @@ try { co_return result::failure(std::current_exception()); } -Worker::Results Worker::run(std::function<Targets (GoalFactory &)> req) -{ +kj::Promise<Result<Worker::Results>> Worker::run(std::function<Targets (GoalFactory &)> req) +try { auto topGoals = req(goalFactory()); assert(!running); @@ -252,7 +252,9 @@ Worker::Results Worker::run(std::function<Targets (GoalFactory &)> req) promise = promise.exclusiveJoin(boopGC(*localStore)); } - return promise.wait(aio.waitScope).value(); + co_return co_await promise; +} catch (...) { + co_return result::failure(std::current_exception()); } kj::Promise<Result<Worker::Results>> Worker::runImpl(Targets topGoals) |