mirror of
https://github.com/NixOS/nix
synced 2025-06-25 10:41:16 +02:00
Use Goal::waitForAWhile
in a few more places
This commit is contained in:
parent
c121daf331
commit
3cb38e8ab9
2 changed files with 3 additions and 6 deletions
|
@ -660,9 +660,8 @@ Goal::Co DerivationGoal::tryToBuild()
|
||||||
if (!actLock)
|
if (!actLock)
|
||||||
actLock = std::make_unique<Activity>(*logger, lvlWarn, actBuildWaiting,
|
actLock = std::make_unique<Activity>(*logger, lvlWarn, actBuildWaiting,
|
||||||
fmt("waiting for a machine to build '%s'", Magenta(worker.store.printStorePath(drvPath))));
|
fmt("waiting for a machine to build '%s'", Magenta(worker.store.printStorePath(drvPath))));
|
||||||
worker.waitForAWhile(shared_from_this());
|
|
||||||
outputLocks.unlock();
|
outputLocks.unlock();
|
||||||
co_await Suspend{};
|
co_await waitForAWhile();
|
||||||
co_return tryToBuild();
|
co_return tryToBuild();
|
||||||
case rpDecline:
|
case rpDecline:
|
||||||
/* We should do it ourselves. */
|
/* We should do it ourselves. */
|
||||||
|
|
|
@ -479,9 +479,8 @@ Goal::Co LocalDerivationGoal::tryLocalBuild()
|
||||||
|
|
||||||
unsigned int curBuilds = worker.getNrLocalBuilds();
|
unsigned int curBuilds = worker.getNrLocalBuilds();
|
||||||
if (curBuilds >= settings.maxBuildJobs) {
|
if (curBuilds >= settings.maxBuildJobs) {
|
||||||
worker.waitForBuildSlot(shared_from_this());
|
|
||||||
outputLocks.unlock();
|
outputLocks.unlock();
|
||||||
co_await Suspend{};
|
co_await waitForBuildSlot();
|
||||||
co_return tryToBuild();
|
co_return tryToBuild();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -535,8 +534,7 @@ Goal::Co LocalDerivationGoal::tryLocalBuild()
|
||||||
if (!actLock)
|
if (!actLock)
|
||||||
actLock = std::make_unique<Activity>(*logger, lvlWarn, actBuildWaiting,
|
actLock = std::make_unique<Activity>(*logger, lvlWarn, actBuildWaiting,
|
||||||
fmt("waiting for a free build user ID for '%s'", Magenta(worker.store.printStorePath(drvPath))));
|
fmt("waiting for a free build user ID for '%s'", Magenta(worker.store.printStorePath(drvPath))));
|
||||||
worker.waitForAWhile(shared_from_this());
|
co_await waitForAWhile();
|
||||||
co_await Suspend{};
|
|
||||||
co_return tryLocalBuild();
|
co_return tryLocalBuild();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue