summaryrefslogtreecommitdiff
path: root/bin/nit-picker
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-09-18 21:53:25 +0200
committerErich Eckner <git@eckner.net>2019-09-18 21:53:25 +0200
commit4caf7ceb7c3f6157e6890781ec463d0afdcc904c (patch)
tree959d18be298e169c1c32be86ddfba48c3ccf744b /bin/nit-picker
parent492394371b39fa562304b45e809e9cb944ee12fa (diff)
downloadbuilder-4caf7ceb7c3f6157e6890781ec463d0afdcc904c.tar.xz
bin/nit-picker: only warn about long-running builds once per day
Diffstat (limited to 'bin/nit-picker')
-rwxr-xr-xbin/nit-picker15
1 files changed, 10 insertions, 5 deletions
diff --git a/bin/nit-picker b/bin/nit-picker
index 44a3e62..f685458 100755
--- a/bin/nit-picker
+++ b/bin/nit-picker
@@ -84,6 +84,8 @@ fi
mysql_load_min_and_max_versions
+build_duration_check=0
+
while pgrep -x ii >/dev/null \
|| ! ${irc}; do
if [ $# -eq 0 ]; then
@@ -119,11 +121,14 @@ while pgrep -x ii >/dev/null \
printf ' WHERE `repositories`.`is_on_master_mirror`'
printf ';\n'
- printf 'SELECT'
- printf ' "build-duration",'
- printf '`build_slaves`.`name`'
- printf ' FROM `build_slaves`'
- printf ';\n'
+ if [ "$(date +%s)" -gt "$((build_duration_check + 60*60*24))" ]; then
+ printf 'SELECT'
+ printf ' "build-duration",'
+ printf '`build_slaves`.`name`'
+ printf ' FROM `build_slaves`'
+ printf ';\n'
+ build_duration_check=$(date +%s)
+ fi
printf 'SELECT DISTINCT'
printf ' "binary-dependencies",'