forked from lix-project/hydra
Fix sending notifications in the successful case
This commit is contained in:
parent
4db7c51b5c
commit
524ee295e0
1 changed files with 13 additions and 6 deletions
|
@ -1157,6 +1157,9 @@ bool State::doBuildStep(std::shared_ptr<StoreAPI> store, Step::ptr step,
|
||||||
this in a loop, marking all known builds, repeating until
|
this in a loop, marking all known builds, repeating until
|
||||||
there are no unmarked builds.
|
there are no unmarked builds.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
std::vector<BuildID> buildIDs;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
|
|
||||||
/* Get the builds that have this one as the top-level. */
|
/* Get the builds that have this one as the top-level. */
|
||||||
|
@ -1203,15 +1206,19 @@ bool State::doBuildStep(std::shared_ptr<StoreAPI> store, Step::ptr step,
|
||||||
auto builds_(builds.lock());
|
auto builds_(builds.lock());
|
||||||
b->finishedInDB = true;
|
b->finishedInDB = true;
|
||||||
builds_->erase(b->id);
|
builds_->erase(b->id);
|
||||||
|
buildIDs.push_back(b->id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Send notification about this build. */
|
/* Send notification about the builds that have this step as
|
||||||
|
the top-level. */
|
||||||
|
for (auto id : buildIDs) {
|
||||||
{
|
{
|
||||||
auto notificationSenderQueue_(notificationSenderQueue.lock());
|
auto notificationSenderQueue_(notificationSenderQueue.lock());
|
||||||
notificationSenderQueue_->push(NotificationItem(build->id, std::vector<BuildID>()));
|
notificationSenderQueue_->push(NotificationItem(id, std::vector<BuildID>()));
|
||||||
}
|
}
|
||||||
notificationSenderWakeup.notify_one();
|
notificationSenderWakeup.notify_one();
|
||||||
|
}
|
||||||
|
|
||||||
/* Wake up any dependent steps that have no other
|
/* Wake up any dependent steps that have no other
|
||||||
dependencies. */
|
dependencies. */
|
||||||
|
@ -1302,7 +1309,6 @@ bool State::doBuildStep(std::shared_ptr<StoreAPI> store, Step::ptr step,
|
||||||
for (auto & build2 : indirect) {
|
for (auto & build2 : indirect) {
|
||||||
if (build2->finishedInDB) continue;
|
if (build2->finishedInDB) continue;
|
||||||
printMsg(lvlError, format("marking build %1% as failed") % build2->id);
|
printMsg(lvlError, format("marking build %1% as failed") % build2->id);
|
||||||
dependentIDs.push_back(build2->id);
|
|
||||||
txn.parameterized
|
txn.parameterized
|
||||||
("update Builds set finished = 1, busy = 0, buildStatus = $2, startTime = $3, stopTime = $4, isCachedBuild = $5 where id = $1 and finished = 0")
|
("update Builds set finished = 1, busy = 0, buildStatus = $2, startTime = $3, stopTime = $4, isCachedBuild = $5 where id = $1 and finished = 0")
|
||||||
(build2->id)
|
(build2->id)
|
||||||
|
@ -1328,6 +1334,7 @@ bool State::doBuildStep(std::shared_ptr<StoreAPI> store, Step::ptr step,
|
||||||
auto builds_(builds.lock());
|
auto builds_(builds.lock());
|
||||||
b->finishedInDB = true;
|
b->finishedInDB = true;
|
||||||
builds_->erase(b->id);
|
builds_->erase(b->id);
|
||||||
|
dependentIDs.push_back(b->id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue