summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-04-02 22:12:57 +0200
committerErich Eckner <git@eckner.net>2018-04-02 22:12:57 +0200
commit8ff3a370205980e8ab47e76488fb661eb81ec282 (patch)
tree01464b5e2a731b70285c32ba8fbec592b6119369
parent8787c5417091be638f1b51d0cb7b452ef2a82565 (diff)
downloadbuilder-8ff3a370205980e8ab47e76488fb661eb81ec282.tar.xz
lib/mysql-functions: mysql_cleanup: remove last_action from build_slaves without an assignment, too
-rwxr-xr-xlib/mysql-functions8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/mysql-functions b/lib/mysql-functions
index 0625616..a1e5a64 100755
--- a/lib/mysql-functions
+++ b/lib/mysql-functions
@@ -863,15 +863,17 @@ mysql_cleanup() {
fi
printf ' WHERE `build_slaves`.`currently_building` IS NOT NULL'
printf ' AND TIMEDIFF(NOW(),`build_slaves`.`last_connection`) > "1:00:00";\n'
- # remove `logged_lines` from buildslaves without an assignment
+ # remove `last_action` and `logged_lines` from buildslaves without an assignment
if [ "${operator}" = 'DELETE' ]; then
printf 'UPDATE `build_slaves`'
- printf ' SET `build_slaves`.`logged_lines`=NULL'
+ printf ' SET `build_slaves`.`last_action`=NULL,'
+ printf ' `build_slaves`.`logged_lines`=NULL'
else
printf 'SELECT COUNT(*) FROM `build_slaves`'
fi
printf ' WHERE `build_slaves`.`currently_building` IS NULL'
- printf ' AND `build_slaves`.`logged_lines` IS NOT NULL;\n'
+ printf ' AND (`build_slaves`.`last_action` IS NOT NULL'
+ printf ' OR `build_slaves`.`logged_lines` IS NOT NULL);\n'
for partition in $(seq 0 $((mysql_files_table_partitions-1))); do
# remove obsolete file_providers
printf '%s FROM `file_providers` PARTITION (p%s)' \