From a4fb93c1196726155997f1d9abb0cee8e3614a66 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 10 Jun 2015 15:36:21 +0200 Subject: [PATCH] Lock builds for a shorter amount of time --- src/hydra-queue-runner/hydra-queue-runner.cc | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/hydra-queue-runner/hydra-queue-runner.cc b/src/hydra-queue-runner/hydra-queue-runner.cc index 844b19ee..788fe975 100644 --- a/src/hydra-queue-runner/hydra-queue-runner.cc +++ b/src/hydra-queue-runner/hydra-queue-runner.cc @@ -421,18 +421,6 @@ void State::getQueuedBuilds(std::shared_ptr store) auto conn(dbPool.get()); -#if 0 - { - auto runnable_(runnable.lock()); - auto builds_(builds.lock()); - auto steps_(steps.lock()); - printMsg(lvlError, format("%1% builds, %2% steps, %3% runnable steps") - % builds_->size() - % steps_->size() - % runnable_->size()); - } -#endif - /* Grab the queued builds from the database, but don't process them yet (since we don't want a long-running transaction). */ std::list newBuilds; // FIXME: use queue @@ -444,9 +432,8 @@ void State::getQueuedBuilds(std::shared_ptr store) // highest. auto res = txn.exec("select * from Builds where finished = 0 order by id"); - auto builds_(builds.lock()); - for (auto const & row : res) { + auto builds_(builds.lock()); BuildID id = row["id"].as(); if (has(*builds_, id)) continue;