From 37c1de524dad0a1363502ac2308f0091dd70b3d2 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Sat, 3 Feb 2018 13:39:50 +0100 Subject: bin/return-assignment: remove build assignment from other build slaves, too, if it was a successful one --- bin/return-assignment | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'bin/return-assignment') diff --git a/bin/return-assignment b/bin/return-assignment index 6c0ae16..bf27232 100755 --- a/bin/return-assignment +++ b/bin/return-assignment @@ -447,9 +447,11 @@ fi printf '%s' "${slave}" | \ base64 -w0 )" - printf 'UPDATE `build_slaves` SET' - printf ' `build_slaves`.`currently_building`=NULL' - printf ' WHERE `build_slaves`.`name`=from_base64("%s");\n' \ + printf 'UPDATE `build_slaves` AS `to_update`' + printf ' JOIN `build_slaves` AS `current_slave`' + printf ' ON `to_update`.`currently_building`=`current_slave`.`currently_building`' + printf ' SET `to_update`.`currently_building`=NULL' + printf ' WHERE `current_slave`.`name`=from_base64("%s");\n' \ "$( printf '%s' "${slave}" | \ base64 -w0 -- cgit v1.2.3-70-g09d2