Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Apr 2017 17:57:30 +0000 (UTC)
From:      "Carlos J. Puga Medina" <cpm@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r438194 - in head/sysutils/bsdstats: . files
Message-ID:  <201704101757.v3AHvU2n063512@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cpm
Date: Mon Apr 10 17:57:30 2017
New Revision: 438194
URL: https://svnweb.freebsd.org/changeset/ports/438194

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

Modified:
  head/sysutils/bsdstats/Makefile
  head/sysutils/bsdstats/files/300.statistics.in

Modified: head/sysutils/bsdstats/Makefile
==============================================================================
--- head/sysutils/bsdstats/Makefile	Mon Apr 10 17:32:58 2017	(r438193)
+++ head/sysutils/bsdstats/Makefile	Mon Apr 10 17:57:30 2017	(r438194)
@@ -3,7 +3,7 @@
 
 PORTNAME=	bsdstats
 PORTVERSION=	6.0
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	sysutils
 DISTFILES=
 

Modified: head/sysutils/bsdstats/files/300.statistics.in
==============================================================================
--- head/sysutils/bsdstats/files/300.statistics.in	Mon Apr 10 17:32:58 2017	(r438193)
+++ head/sysutils/bsdstats/files/300.statistics.in	Mon Apr 10 17:57:30 2017	(r438194)
@@ -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



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