index : builder | |
Archlinux32 build system | gitolite user |
summaryrefslogtreecommitdiff |
author | Erich Eckner <git@eckner.net> | 2018-03-27 09:32:44 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-03-27 09:32:44 +0200 |
commit | 6a9286eedc3bb7034c4174d418a0bdd8cff69f69 (patch) | |
tree | 904c5e5414bbf0ec2935ed3aaa64dd0a47a9c377 /lib/mysql-functions | |
parent | 9e7bb62bb58ca3a50e35fa8b814ce16b6973ab18 (diff) |
-rwxr-xr-x | lib/mysql-functions | 17 |
diff --git a/lib/mysql-functions b/lib/mysql-functions index 129a20f..8e8217b 100755 --- a/lib/mysql-functions +++ b/lib/mysql-functions @@ -875,6 +875,23 @@ 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 obsolete file_providers + printf '%s FROM `file_providers`' \ + "${operator}" + printf ' WHERE NOT EXISTS (' + printf 'SELECT * FROM `binary_packages`' + printf ' WHERE `binary_packages`.`id`=`file_providers`.`package`' + printf ') OR NOT EXISTS (' + printf 'SELECT * FROM `files`' + printf ' WHERE `files`.`id`=`file_providers`.`file`' + printf ');\n' + # remove obsolete files + printf '%s FROM `files`' \ + "${operator}" + printf ' WHERE NOT EXISTS (' + printf 'SELECT * FROM `file_providers`' + printf ' WHERE `files`.`id`=`file_providers`.`file`' + printf ');\n' } | \ mysql_run_query } |