aboutsummaryrefslogtreecommitdiff
path: root/mail/sa-utils
diff options
context:
space:
mode:
authorMatthew Seaman <matthew@FreeBSD.org>2017-04-07 07:11:40 +0000
committerMatthew Seaman <matthew@FreeBSD.org>2017-04-07 07:11:40 +0000
commite46a5ad0c5845b3f9dde303fa3d919ec0a9c14cd (patch)
treebb44f7b430c5f2750fe2a58fb0118f831b4b3f04 /mail/sa-utils
parented53e1684211f736da1e0ae246dd595598bd0ad9 (diff)
downloadports-e46a5ad0c5845b3f9dde303fa3d919ec0a9c14cd.tar.gz
ports-e46a5ad0c5845b3f9dde303fa3d919ec0a9c14cd.zip
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
Notes
Notes: svn path=/head/; revision=437913
Diffstat (limited to 'mail/sa-utils')
-rw-r--r--mail/sa-utils/Makefile3
-rw-r--r--mail/sa-utils/files/sa-utils.in10
2 files changed, 11 insertions, 2 deletions
diff --git a/mail/sa-utils/Makefile b/mail/sa-utils/Makefile
index 2c751454dd61..b072646f7af0 100644
--- a/mail/sa-utils/Makefile
+++ b/mail/sa-utils/Makefile
@@ -2,8 +2,7 @@
# $FreeBSD$
PORTNAME= sa-utils
-PORTVERSION= 0.02
-PORTREVISION= 2
+PORTVERSION= 0.03
CATEGORIES= mail
MASTER_SITES= # none
DISTFILES= # none
diff --git a/mail/sa-utils/files/sa-utils.in b/mail/sa-utils/files/sa-utils.in
index 77a88ecd24c1..3dbf7e16a673 100644
--- a/mail/sa-utils/files/sa-utils.in
+++ b/mail/sa-utils/files/sa-utils.in
@@ -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)