1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 22:33:57 +02:00

Merge pull request #12747 from obsidiansystems/more-goal-waitForAWhile

Use `Goal::waitForAWhile` in a few more places
This commit is contained in:
mergify[bot] 2025-03-24 17:28:20 +00:00 committed by GitHub
commit 5a4e306cc5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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();
}
}