1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 14:51:16 +02:00

Use Goal::waitForAWhile in a few more places

This commit is contained in:
Las 2025-03-17 22:42:39 +00:00 committed by John Ericson
parent c121daf331
commit 3cb38e8ab9
2 changed files with 3 additions and 6 deletions

View file

@ -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. */

View file

@ -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();
}
}