From 84fb0312c4caa2f445fe95f46ce9896d2a2f3945 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 13 Sep 2018 10:46:28 +0200 Subject: bin/get-assignment: keep currently building assignments for some time longer in the temporary table --- bin/get-assignment | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'bin') diff --git a/bin/get-assignment b/bin/get-assignment index 0ce35e9..b5dd33d 100755 --- a/bin/get-assignment +++ b/bin/get-assignment @@ -177,11 +177,7 @@ next_building=$( printf ' AND `architecture_compatibilities`.`fully_compatible`' printf ' JOIN `architectures`' printf ' ON `architecture_compatibilities`.`runs_on`=`architectures`.`id`' - printf ' WHERE NOT EXISTS (' - printf ' SELECT 1' - printf ' FROM `build_slaves`' - printf ' WHERE `build_slaves`.`currently_building`=`build_assignments`.`id`' - printf ') AND (' + printf ' WHERE (' printf '`build_assignments`.`is_blocked` IS NULL' if [ -n "${requested}" ]; then printf ' OR' @@ -198,6 +194,11 @@ next_building=$( printf ' AND `architectures`.`name` = from_base64("%s");\n' \ "${arch}" + printf 'DELETE `considered_build_assignments`' + printf ' FROM `considered_build_assignments`' + mysql_join_build_assignments_build_slaves 'considered_build_assignments' + printf ';\n' + printf 'SELECT `considered_build_assignments`.`id` FROM' printf ' `considered_build_assignments`' printf ' JOIN `build_assignments`' -- cgit v1.2.3