Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Apr 2017 07:11:40 +0000 (UTC)
From:      Matthew Seaman <matthew@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r437913 - in head/mail/sa-utils: . files
Message-ID:  <201704070711.v377BeqT007343@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: matthew
Date: Fri Apr  7 07:11:40 2017
New Revision: 437913
URL: https://svnweb.freebsd.org/changeset/ports/437913

Log:
  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

Modified:
  head/mail/sa-utils/Makefile
  head/mail/sa-utils/files/sa-utils.in

Modified: head/mail/sa-utils/Makefile
==============================================================================
--- head/mail/sa-utils/Makefile	Fri Apr  7 05:34:13 2017	(r437912)
+++ head/mail/sa-utils/Makefile	Fri Apr  7 07:11:40 2017	(r437913)
@@ -2,8 +2,7 @@
 # $FreeBSD$
 
 PORTNAME=	sa-utils
-PORTVERSION=	0.02
-PORTREVISION=	2
+PORTVERSION=	0.03
 CATEGORIES=	mail
 MASTER_SITES=	# none
 DISTFILES=	# none

Modified: head/mail/sa-utils/files/sa-utils.in
==============================================================================
--- head/mail/sa-utils/files/sa-utils.in	Fri Apr  7 05:34:13 2017	(r437912)
+++ head/mail/sa-utils/files/sa-utils.in	Fri Apr  7 07:11:40 2017	(r437913)
@@ -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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201704070711.v377BeqT007343>