index : builder | |
Archlinux32 build system | gitolite user |
summaryrefslogtreecommitdiff |
author | Erich Eckner <git@eckner.net> | 2023-05-15 22:22:00 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2023-05-15 22:22:00 +0200 |
commit | 82f9063ea0b5855603a516def56ce1b41f62909e (patch) | |
tree | d04d826f5aa639a7caad166bf116dabee30a9809 | |
parent | 1e73a512b4e04e3d525afe1a1d6d6f7abdbead87 (diff) |
-rwxr-xr-x | lib/mysql-functions | 30 |
diff --git a/lib/mysql-functions b/lib/mysql-functions index c27babc..54de45e 100755 --- a/lib/mysql-functions +++ b/lib/mysql-functions @@ -1755,20 +1755,24 @@ mysql_query_ordering_correct() { # active build slaves mysql_determine_majority_build_slave_architecture_id() { { - printf 'SELECT' - printf ' COUNT(DISTINCT `ssh_log`.`id`) AS `count`,' - printf '`architectures`.`id`' - printf ' FROM `ssh_log`' - printf ' JOIN `architectures`' - printf ' ON `ssh_log`.`parameters`=CONCAT(`architectures`.`name`," ")' - printf ' WHERE `action`="get-assignment"' - printf ' AND `ssh_log`.`date`>ADDTIME(NOW(),"-1 00:00:00")' - printf ' GROUP BY `ssh_log`.`parameters`' - printf ' ORDER BY `count` DESC' - printf ' LIMIT 1' + { + printf 'SELECT' + printf ' COUNT(DISTINCT `ssh_log`.`id`) AS `count`,' + printf '`architectures`.`id`' + printf ' FROM `ssh_log`' + printf ' JOIN `architectures`' + printf ' ON `ssh_log`.`parameters`=CONCAT(`architectures`.`name`," ")' + printf ' WHERE `action`="get-assignment"' + printf ' AND `ssh_log`.`date`>ADDTIME(NOW(),"-1 00:00:00")' + printf ' GROUP BY `ssh_log`.`parameters`' + printf ' ORDER BY `count` DESC' + printf ' LIMIT 1' + } | \ + mysql_run_query | \ + cut -f2 + echo '-1' } | \ - mysql_run_query | \ - cut -f2 + head -n1 } # mysql_query_delete_packages $package_sources_condition $repositories_condition |