From 69387349879acc40799478b92c8f693c7fceae4d Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 22 Jan 2018 16:16:36 +0100 Subject: bin/return-assignment: split mysql update in two steps to not lose the connection between entries --- bin/return-assignment | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'bin/return-assignment') diff --git a/bin/return-assignment b/bin/return-assignment index e14e93e..c504bf6 100755 --- a/bin/return-assignment +++ b/bin/return-assignment @@ -425,7 +425,6 @@ fi printf ' JOIN `binary_packages` ON `binary_packages`.`build_assignment`=`build_assignments`.`id`' printf ' SET' printf ' `build_assignments`.`is_broken`=0,' - printf ' `build_slaves`.`currently_building`=NULL,' printf ' `binary_packages`.`repository`=(SELECT `repositories`.`id` FROM `repositories` WHERE `repositories`.`name`=from_base64("%s")),' \ "$( printf '%s' "${destination}" | \ @@ -438,6 +437,13 @@ 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 '%s' "${slave}" | \ + base64 -w0 + )" } | \ ${mysql_command} rm -f \ -- cgit v1.2.3-70-g09d2