summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-06-05 10:09:48 +0200
committerErich Eckner <git@eckner.net>2018-06-05 10:09:48 +0200
commit32d6bf75ace4b53691647a7c272aa631fccb36e5 (patch)
treea299eb0190b8b6a3b0d299304b60689301a3feaa
parentd5bf4b445d9874523cdd9d8d8231452bde8732b5 (diff)
downloadbuilder-32d6bf75ace4b53691647a7c272aa631fccb36e5.tar.xz
bin/get-assignment: only connect once to mysqld
-rwxr-xr-xbin/get-assignment9
1 files changed, 3 insertions, 6 deletions
diff --git a/bin/get-assignment b/bin/get-assignment
index d729444..a57780e 100755
--- a/bin/get-assignment
+++ b/bin/get-assignment
@@ -39,6 +39,7 @@ hand_out_assignment() {
printf ' AND `build_assignments`.`id`=%s' \
"$1"
printf ' LIMIT 1;\n'
+
printf 'SELECT '
mysql_package_name_query
printf ' FROM `binary_packages`'
@@ -49,12 +50,7 @@ hand_out_assignment() {
printf ' AND `binary_packages_in_repositories`.`repository`=%s' \
"${repository_ids__any_build_list}"
printf ';\n'
- } | \
- mysql_run_query | \
- tr '\t' ' '
- # shellcheck disable=SC2016
- {
printf 'UPDATE `build_slaves`'
printf ' SET `currently_building`=%s' \
"$1"
@@ -67,7 +63,8 @@ hand_out_assignment() {
printf ' WHERE `build_assignments`.`id`=%s;\n' \
"$1"
} | \
- mysql_run_query
+ mysql_run_query | \
+ tr '\t' ' '
exit 0