[CalendarServer-changes] [3871] CalendarServer/branches/users/wsanchez/deployment/twistedcaldav/ httpfactory.py

source_changes at macosforge.org source_changes at macosforge.org
Mon Mar 16 12:45:17 PDT 2009


Revision: 3871
          http://trac.macosforge.org/projects/calendarserver/changeset/3871
Author:   wsanchez at apple.com
Date:     2009-03-16 12:45:17 -0700 (Mon, 16 Mar 2009)
Log Message:
-----------
expovariate -> randint

Modified Paths:
--------------
    CalendarServer/branches/users/wsanchez/deployment/twistedcaldav/httpfactory.py

Modified: CalendarServer/branches/users/wsanchez/deployment/twistedcaldav/httpfactory.py
===================================================================
--- CalendarServer/branches/users/wsanchez/deployment/twistedcaldav/httpfactory.py	2009-03-16 19:41:32 UTC (rev 3870)
+++ CalendarServer/branches/users/wsanchez/deployment/twistedcaldav/httpfactory.py	2009-03-16 19:45:17 UTC (rev 3871)
@@ -14,7 +14,7 @@
 # limitations under the License.
 ##
 
-from random import expovariate
+from random import randint
 
 from twisted.internet import protocol
 from twisted.python import log
@@ -33,9 +33,7 @@
         if config.MoreAccessLogData:
             log.msg(overloaded=self)
 
-        retryAfter = int(expovariate(1.0/config.HTTPRetryAfter))
-        if retryAfter > 2 * config.HTTPRetryAfter:
-            retryAfter = config.HTTPRetryAfter
+        retryAfter = randint(int(config.HTTPRetryAfter * 1/2), int(config.HTTPRetryAfter * 3/2))
 
         self.transport.write("HTTP/1.0 503 Service Unavailable\r\n"
                              "Content-Type: text/html\r\n"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20090316/97897fae/attachment.html>


More information about the calendarserver-changes mailing list