Merge pull request #12747 from obsidiansystems/more-goal-waitForAWhile
Use `Goal::waitForAWhile` in a few more places
This commit is contained in:
@@ -660,9 +660,8 @@ Goal::Co DerivationGoal::tryToBuild()
|
||||
if (!actLock)
|
||||
actLock = std::make_unique<Activity>(*logger, lvlWarn, actBuildWaiting,
|
||||
fmt("waiting for a machine to build '%s'", Magenta(worker.store.printStorePath(drvPath))));
|
||||
worker.waitForAWhile(shared_from_this());
|
||||
outputLocks.unlock();
|
||||
co_await Suspend{};
|
||||
co_await waitForAWhile();
|
||||
co_return tryToBuild();
|
||||
case rpDecline:
|
||||
/* We should do it ourselves. */
|
||||
|
||||
@@ -479,9 +479,8 @@ Goal::Co LocalDerivationGoal::tryLocalBuild()
|
||||
|
||||
unsigned int curBuilds = worker.getNrLocalBuilds();
|
||||
if (curBuilds >= settings.maxBuildJobs) {
|
||||
worker.waitForBuildSlot(shared_from_this());
|
||||
outputLocks.unlock();
|
||||
co_await Suspend{};
|
||||
co_await waitForBuildSlot();
|
||||
co_return tryToBuild();
|
||||
}
|
||||
|
||||
@@ -535,8 +534,7 @@ Goal::Co LocalDerivationGoal::tryLocalBuild()
|
||||
if (!actLock)
|
||||
actLock = std::make_unique<Activity>(*logger, lvlWarn, actBuildWaiting,
|
||||
fmt("waiting for a free build user ID for '%s'", Magenta(worker.store.printStorePath(drvPath))));
|
||||
worker.waitForAWhile(shared_from_this());
|
||||
co_await Suspend{};
|
||||
co_await waitForAWhile();
|
||||
co_return tryLocalBuild();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user