Acquire exclusive table lock earlier
This commit is contained in:
parent
69be3cfe93
commit
8257812d0a
|
@ -601,13 +601,13 @@ void State::getQueuedBuilds(Connection & conn, std::shared_ptr<StoreAPI> store,
|
||||||
if (buildStatus != bsSuccess) {
|
if (buildStatus != bsSuccess) {
|
||||||
time_t now = time(0);
|
time_t now = time(0);
|
||||||
pqxx::work txn(conn);
|
pqxx::work txn(conn);
|
||||||
|
createBuildStep(txn, 0, build, r, "", buildStepStatus);
|
||||||
txn.parameterized
|
txn.parameterized
|
||||||
("update Builds set finished = 1, busy = 0, buildStatus = $2, startTime = $3, stopTime = $3, isCachedBuild = $4 where id = $1")
|
("update Builds set finished = 1, busy = 0, buildStatus = $2, startTime = $3, stopTime = $3, isCachedBuild = $4 where id = $1")
|
||||||
(build->id)
|
(build->id)
|
||||||
((int) buildStatus)
|
((int) buildStatus)
|
||||||
(now)
|
(now)
|
||||||
(buildStatus != bsUnsupported ? 1 : 0).exec();
|
(buildStatus != bsUnsupported ? 1 : 0).exec();
|
||||||
createBuildStep(txn, 0, build, r, "", buildStepStatus);
|
|
||||||
txn.commit();
|
txn.commit();
|
||||||
nrBuildsDone++;
|
nrBuildsDone++;
|
||||||
badStep = true;
|
badStep = true;
|
||||||
|
|
Loading…
Reference in a new issue