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:
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
|
@ -2,8 +2,7 @@
|
||||||
# $FreeBSD$
|
# $FreeBSD$
|
||||||
|
|
||||||
PORTNAME= sa-utils
|
PORTNAME= sa-utils
|
||||||
PORTVERSION= 0.02
|
PORTVERSION= 0.03
|
||||||
PORTREVISION= 2
|
|
||||||
CATEGORIES= mail
|
CATEGORIES= mail
|
||||||
MASTER_SITES= # none
|
MASTER_SITES= # none
|
||||||
DISTFILES= # none
|
DISTFILES= # none
|
||||||
|
|
|
@ -142,6 +142,16 @@ case "$daily_sa_enable" in
|
||||||
;;
|
;;
|
||||||
esac
|
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=$?
|
update_rules || rc=$?
|
||||||
case ${rc} in
|
case ${rc} in
|
||||||
0)
|
0)
|
||||||
|
|
Loading…
Reference in a new issue