Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/get-assignment
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-09-13 10:46:28 +0200
committerErich Eckner <git@eckner.net>2018-09-13 10:46:28 +0200
commit84fb0312c4caa2f445fe95f46ce9896d2a2f3945 (patch)
tree3febf09bd83fae0013267e0d543661cc832c9602 /bin/get-assignment
parent9782615be40525365c6cf46f5ced09dd0aa934a7 (diff)
bin/get-assignment: keep currently building assignments for some time longer in the temporary table
Diffstat (limited to 'bin/get-assignment')
-rwxr-xr-xbin/get-assignment11
1 files changed, 6 insertions, 5 deletions
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`'