Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-09-19 06:23:39 +0200
committerErich Eckner <git@eckner.net>2019-09-19 06:23:39 +0200
commit3a505e4c944af219091b5a6390f61fb75733ecda (patch)
tree9bbb0a955b17ce064c9bf1329a427d8daf07b038 /bin
parent4caf7ceb7c3f6157e6890781ec463d0afdcc904c (diff)
bin/nit-picker: really check build duration only once a day
Diffstat (limited to 'bin')
-rwxr-xr-xbin/nit-picker9
1 files changed, 7 insertions, 2 deletions
diff --git a/bin/nit-picker b/bin/nit-picker
index f685458..4caa4e0 100755
--- a/bin/nit-picker
+++ b/bin/nit-picker
@@ -89,6 +89,12 @@ build_duration_check=0
while pgrep -x ii >/dev/null \
|| ! ${irc}; do
if [ $# -eq 0 ]; then
+ if [ "$(date +%s)" -gt "$((build_duration_check + 60*60*24))" ]; then
+ check_build_duration=true
+ build_duration_check=$(date +%s)
+ else
+ check_build_duration=false
+ fi
# shellcheck disable=SC2016
{
printf 'SELECT DISTINCT'
@@ -121,13 +127,12 @@ while pgrep -x ii >/dev/null \
printf ' WHERE `repositories`.`is_on_master_mirror`'
printf ';\n'
- if [ "$(date +%s)" -gt "$((build_duration_check + 60*60*24))" ]; then
+ if "${check_build_duration}"; 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'