Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/mysql-functions
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-04-17 15:28:07 +0200
committerErich Eckner <git@eckner.net>2018-04-17 15:28:07 +0200
commit9b0c3a597a6421b318e34b46de2b991c84d22f2a (patch)
treece681fceb57551eaad7b1c16ee5ff28d471d6ad8 /lib/mysql-functions
parentd26a78b39f019ae7411fb3ba26633f74973943bd (diff)
lib/mysql-functions: make last_connection obsolete
Diffstat (limited to 'lib/mysql-functions')
-rwxr-xr-xlib/mysql-functions18
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/mysql-functions b/lib/mysql-functions
index c799877..048f163 100755
--- a/lib/mysql-functions
+++ b/lib/mysql-functions
@@ -880,7 +880,10 @@ mysql_cleanup() {
printf 'SELECT COUNT(*) FROM `build_slaves`'
fi
printf ' WHERE `build_slaves`.`currently_building` IS NOT NULL'
- printf ' AND TIMEDIFF(NOW(),`build_slaves`.`last_connection`) > "1:00:00";\n'
+ printf ' AND TIMEDIFF(NOW(),('
+ 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
if [ "${operator}" = 'DELETE' ]; then
printf 'UPDATE `build_slaves`'
@@ -1095,6 +1098,9 @@ mysql_join__generic() {
}
for link in \
+ 'allowed_email_actions:action:email_actions' \
+ 'allowed_email_actions:gpg_key:gpg_keys' \
+ \
'binary_packages:architecture:architectures' \
'binary_packages:repository:repositories' \
'binary_packages:build_assignment:build_assignments' \
@@ -1107,15 +1113,21 @@ for link in \
\
'build_slaves:currently_building:build_assignments' \
'build_slaves:currently_building build_assignment:binary_packages' \
+ 'build_slaves:ssh_key:ssh_keys' \
\
'dependencies:depending_on:install_targets' \
'dependencies:dependent:binary_packages' \
'dependencies:dependency_type:dependency_types' \
\
+ 'email_log:action:email_actions' \
+ 'email_log:gpg_key:gpg_keys' \
+ \
'failed_builds:reason:fail_reason' \
'failed_builds:build_assignment:build_assignments' \
'failed_builds:build_slave:build_slaves' \
\
+ 'gpg_keys:owner:persons' \
+ \
'install_target_providers:package:binary_packages' \
'install_target_providers:install_target:install_targets' \
'install_target_providers:install_target depending_on:dependencies' \
@@ -1127,6 +1139,10 @@ for link in \
'repository_moves:upstream_package_repository:upstream_repositories' \
'repository_moves:upstream_package_repository upstream_package_repository:package_sources' \
\
+ 'ssh_keys:owner:persons' \
+ \
+ 'ssh_log:build_slave:build_slaves' \
+ \
'upstream_repositories:git_repository:git_repositories'; do
# A join for these cannot be done, because it's not clear on what to join:
# 'repository_stability_relations:more_stable:repository_stabilities'