mirror of
https://github.com/NixOS/nix
synced 2025-07-07 18:31:49 +02:00
Merge pull request #12747 from obsidiansystems/more-goal-waitForAWhile
Use `Goal::waitForAWhile` in a few more places
This commit is contained in:
commit
5a4e306cc5
2 changed files with 3 additions and 6 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue