- 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)
This commit is contained in:
Carlos J. Puga Medina
2017-04-10 17:57:30 +00:00
parent f818997cb6
commit da84505cff
2 changed files with 11 additions and 3 deletions

View File

@@ -3,7 +3,7 @@
PORTNAME= bsdstats
PORTVERSION= 6.0
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= sysutils
DISTFILES=

View File

@@ -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