summaryrefslogtreecommitdiff
path: root/lib/mysql-functions
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-06-01 11:19:05 +0200
committerErich Eckner <git@eckner.net>2018-06-01 11:19:05 +0200
commit2944fd6d91d437147521c48b6c9d30ab50755152 (patch)
tree19ff45c8a74f0ffe5c86da59b38246d01c417283 /lib/mysql-functions
parent265d12032a1f1fb1b177444d86e90ace5c244c2a (diff)
downloadbuilder-2944fd6d91d437147521c48b6c9d30ab50755152.tar.xz
lib/mysql-functions, bin/return-assignment: keep build_slaves information synchronously up-to-date
Diffstat (limited to 'lib/mysql-functions')
-rwxr-xr-xlib/mysql-functions8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/mysql-functions b/lib/mysql-functions
index cb76dac..2670c9b 100755
--- a/lib/mysql-functions
+++ b/lib/mysql-functions
@@ -900,17 +900,19 @@ mysql_cleanup() {
printf 'SELECT MAX(`ssh_log`.`date`) FROM `ssh_log`'
printf ' WHERE `ssh_log`.`build_slave`=`build_slaves`.`id`'
printf ')) > "1:00:00";\n'
- # remove `last_action` and `logged_lines` from buildslaves without an assignment
+ # remove `last_action`, `trials` and `logged_lines` from buildslaves without an assignment
if [ "${operator}" = 'DELETE' ]; then
printf 'UPDATE `build_slaves`'
printf ' SET `build_slaves`.`last_action`=NULL,'
- printf ' `build_slaves`.`logged_lines`=NULL'
+ printf ' `build_slaves`.`logged_lines`=NULL,'
+ printf ' `build_slaves`.`trials`=NULL'
else
printf 'SELECT COUNT(1) FROM `build_slaves`'
fi
printf ' WHERE `build_slaves`.`currently_building` IS NULL'
printf ' AND (`build_slaves`.`last_action` IS NOT NULL'
- printf ' OR `build_slaves`.`logged_lines` IS NOT NULL);\n'
+ printf ' OR `build_slaves`.`logged_lines` IS NOT NULL'
+ printf ' OR `build_slaves`.`trials` IS NOT NULL);\n'
} | \
mysql_run_query 'unimportant'
}