summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-01-22 16:16:36 +0100
committerErich Eckner <git@eckner.net>2018-01-22 16:16:36 +0100
commit69387349879acc40799478b92c8f693c7fceae4d (patch)
treeeada123dac846f618f3045a60e6b7cdfc2a43450 /bin
parent22fed81b1fbce3431d4c2349b0694d3bb7c6a36b (diff)
downloadbuilder-69387349879acc40799478b92c8f693c7fceae4d.tar.xz
bin/return-assignment: split mysql update in two steps to not lose the connection between entries
Diffstat (limited to 'bin')
-rwxr-xr-xbin/return-assignment8
1 files changed, 7 insertions, 1 deletions
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 \