aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils/bsdstats
diff options
context:
space:
mode:
authorcpm <cpm@FreeBSD.org>2017-04-11 01:57:30 +0800
committercpm <cpm@FreeBSD.org>2017-04-11 01:57:30 +0800
commit598d4069d206dfa0775787a8584fe17f1847fc2d (patch)
tree57975f858cd97d02eddac103fe0722b2609174f2 /sysutils/bsdstats
parent4ac9a08e5233445485063bcd292afc5a9d93e771 (diff)
downloadfreebsd-ports-gnome-598d4069d206dfa0775787a8584fe17f1847fc2d.tar.gz
freebsd-ports-gnome-598d4069d206dfa0775787a8584fe17f1847fc2d.tar.zst
freebsd-ports-gnome-598d4069d206dfa0775787a8584fe17f1847fc2d.zip
- Use anticongestion instead of simply sleeping.
- Bump PORTREVISION svn r316342 added a common anticongestion routine that all periodic scripts should use instead of simply calling sleep. To test if it's available, a port should check for the anticongestion_sleeptime variable. PR: 218283 Submitted by: asomers Approved by: Yuri Victorovich <yuri@rawbw.com> (maintainer)
Diffstat (limited to 'sysutils/bsdstats')
-rw-r--r--sysutils/bsdstats/Makefile2
-rw-r--r--sysutils/bsdstats/files/300.statistics.in12
2 files changed, 11 insertions, 3 deletions
diff --git a/sysutils/bsdstats/Makefile b/sysutils/bsdstats/Makefile
index 23bb6a774ce6..8512cfc618da 100644
--- a/sysutils/bsdstats/Makefile
+++ b/sysutils/bsdstats/Makefile
@@ -3,7 +3,7 @@
PORTNAME= bsdstats
PORTVERSION= 6.0
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= sysutils
DISTFILES=
diff --git a/sysutils/bsdstats/files/300.statistics.in b/sysutils/bsdstats/files/300.statistics.in
index 9b867b9c0677..936bfad4c454 100644
--- a/sysutils/bsdstats/files/300.statistics.in
+++ b/sysutils/bsdstats/files/300.statistics.in
@@ -494,8 +494,16 @@ report_all() {
setup_proxies
test_connection
log "INIT" "Connected to ${checkin_server_description}"
- # sleep random number of seconds by default
- test X"$1" = X-nodelay || ${SLEEP} $(random)
+ # When non-interactive, sleep to reduce congestion on bsdstats.org
+ if [ "$1" != -nodelay ]; then
+ # In FreeBSD 12.0 the anticongestion function should be used
+ # instead of a hard-coded sleep
+ if [ -n "$anticongestion_sleeptime" ]; then
+ anticongestion
+ else
+ ${SLEEP} $(random)
+ fi
+ fi
# prepare
get_id_token
# begin