New version: 0.03

Add a random delay using the standard 'anticongestion' function (where
available) before attempting to download updates.  This to avoid the
'thundering herd' of many simultaneous downloads.

PR:		218444
Reported by:	asomers
This commit is contained in:
Matthew Seaman 2017-04-07 07:11:40 +00:00
parent ed53e16842
commit e46a5ad0c5
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=437913
2 changed files with 11 additions and 2 deletions

View file

@ -2,8 +2,7 @@
# $FreeBSD$
PORTNAME= sa-utils
PORTVERSION= 0.02
PORTREVISION= 2
PORTVERSION= 0.03
CATEGORIES= mail
MASTER_SITES= # none
DISTFILES= # none

View file

@ -142,6 +142,16 @@ case "$daily_sa_enable" in
;;
esac
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
update_rules || rc=$?
case ${rc} in
0)