aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libstore/build/worker.cc30
-rw-r--r--src/libstore/build/worker.hh7
2 files changed, 9 insertions, 28 deletions
diff --git a/src/libstore/build/worker.cc b/src/libstore/build/worker.cc
index 82acbdb3d..7fc6198cf 100644
--- a/src/libstore/build/worker.cc
+++ b/src/libstore/build/worker.cc
@@ -94,7 +94,15 @@ std::pair<std::shared_ptr<G>, kj::Promise<Result<Goal::WorkResult>>> Worker::mak
}(goal, map, it);
};
cachedGoal.promise = kj::evalLater(std::move(removeWhenDone)).fork();
- childStarted(goal, cachedGoal.promise.addBranch());
+ children.add(cachedGoal.promise.addBranch().then([this](auto _result) {
+ if (_result.has_value()) {
+ auto & result = _result.value();
+ permanentFailure |= result.permanentFailure;
+ timedOut |= result.timedOut;
+ hashMismatch |= result.hashMismatch;
+ checkMismatch |= result.checkMismatch;
+ }
+ }));
} else {
if (!modify(*goal)) {
cachedGoal = {};
@@ -195,26 +203,6 @@ std::pair<GoalPtr, kj::Promise<Result<Goal::WorkResult>>> Worker::makeGoal(const
}, req.raw());
}
-
-void Worker::goalFinished(GoalPtr goal, Goal::WorkResult & f)
-{
- permanentFailure |= f.permanentFailure;
- timedOut |= f.timedOut;
- hashMismatch |= f.hashMismatch;
- checkMismatch |= f.checkMismatch;
-}
-
-void Worker::childStarted(GoalPtr goal, kj::Promise<Result<Goal::WorkResult>> promise)
-{
- children.add(promise
- .then([this, goal](auto result) {
- if (result.has_value()) {
- goalFinished(goal, result.assume_value());
- }
- }));
-}
-
-
kj::Promise<Result<Worker::Results>> Worker::updateStatistics()
try {
while (true) {
diff --git a/src/libstore/build/worker.hh b/src/libstore/build/worker.hh
index fcf0ad8c7..1a913ca16 100644
--- a/src/libstore/build/worker.hh
+++ b/src/libstore/build/worker.hh
@@ -132,13 +132,6 @@ private:
*/
bool checkMismatch = false;
- void goalFinished(GoalPtr goal, Goal::WorkResult & f);
-
- /**
- * Registers a running child process.
- */
- void childStarted(GoalPtr goal, kj::Promise<Result<Goal::WorkResult>> promise);
-
/**
* Pass current stats counters to the logger for progress bar updates.
*/