From 32d6bf75ace4b53691647a7c272aa631fccb36e5 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 5 Jun 2018 10:09:48 +0200 Subject: bin/get-assignment: only connect once to mysqld --- bin/get-assignment | 9 +++------ 1 file 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 -- cgit v1.2.3-70-g09d2