hydra-queue-runner: Make build notification more reliable
Previously, when hydra-queue-runner was restarted, any pending "build finished" notifications were lost. Now hydra-queue-runner marks finished but unnotified builds in the database and uses that to run pending notifications at startup.
This commit is contained in:
@ -188,7 +188,8 @@ bool State::getQueuedBuilds(Connection & conn,
|
||||
|
||||
createBuildStep(txn, 0, build->id, ex.step, "", bsCachedFailure, "", propagatedFrom);
|
||||
txn.parameterized
|
||||
("update Builds set finished = 1, buildStatus = $2, startTime = $3, stopTime = $3, isCachedBuild = 1 where id = $1 and finished = 0")
|
||||
("update Builds set finished = 1, buildStatus = $2, startTime = $3, stopTime = $3, isCachedBuild = 1, notificationPendingSince = $3 "
|
||||
"where id = $1 and finished = 0")
|
||||
(build->id)
|
||||
((int) (ex.step->drvPath == build->drvPath ? bsFailed : bsDepFailed))
|
||||
(time(0)).exec();
|
||||
|
Reference in New Issue
Block a user