[Checkins] SVN: zope3org/trunk/src/zorg/live/server.py Added a environment variable for test timeouts

Uwe Oestermeier uwe_oestermeier at iwm-kmrc.de
Mon Apr 10 10:13:49 EDT 2006


Log message for revision 66786:
  Added a environment variable for test timeouts

Changed:
  U   zope3org/trunk/src/zorg/live/server.py

-=-
Modified: zope3org/trunk/src/zorg/live/server.py
===================================================================
--- zope3org/trunk/src/zorg/live/server.py	2006-04-10 13:57:48 UTC (rev 66785)
+++ zope3org/trunk/src/zorg/live/server.py	2006-04-10 14:13:48 UTC (rev 66786)
@@ -45,8 +45,13 @@
 
 badRequest = object()
 securityInputLimit = 64000
+requestTimeOut = 30
 
+timeout = os.getenv('LIVESERVER_TIMEOUT')
+if timeout:
+    requestTimeOut = int(timeout)
 
+
 class ExtractionError(Exception) :
     """ Indicates a failed search for a URI part. """
         
@@ -169,8 +174,7 @@
 class LivePageWSGIHandler(WSGIHandler) :
     
     idleInterval = 0.1
-    limit = 30
-    
+
     count = 0
     client = None
     result = None
@@ -186,7 +190,8 @@
 
                 
     def runLive(self) :
-        self.expires = time.time() + self.limit
+        global requestTimeOut
+        self.expires = time.time() + requestTimeOut
         reactor.callLater(self.idleInterval, self.onIdle)
 
     def _returnOutput(self, output) :



More information about the Checkins mailing list