summaryrefslogtreecommitdiff
path: root/crocoite
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2018-10-30 16:47:04 +0100
committerLars-Dominik Braun <lars@6xq.net>2018-10-30 16:47:04 +0100
commitb82991172968e665fa5882742148a675cf880135 (patch)
tree2bf2bfb15821bce589c94c9e7c3669f0b341838f /crocoite
parentc029e087d63444a88cb1e6afeca3e87c0f6f14bc (diff)
downloadcrocoite-b82991172968e665fa5882742148a675cf880135.tar.gz
crocoite-b82991172968e665fa5882742148a675cf880135.tar.bz2
crocoite-b82991172968e665fa5882742148a675cf880135.zip
Reduce idle wait time after stopping page
Diffstat (limited to 'crocoite')
-rw-r--r--crocoite/controller.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/crocoite/controller.py b/crocoite/controller.py
index b1f5f6f..dd39c1d 100644
--- a/crocoite/controller.py
+++ b/crocoite/controller.py
@@ -135,7 +135,7 @@ class SinglePageController:
def run (self):
logger = self.logger
- def processQueue ():
+ def processQueue (idleTimeout=self.settings.idleTimeout):
# XXX: this is very ugly code and does not work well. figure out a
# better way to impose timeouts and still process all items in the
# queue
@@ -146,7 +146,7 @@ class SinglePageController:
while True:
now = time.time ()
elapsed = now-start
- maxTimeout = max (min (self.settings.idleTimeout, self.settings.timeout-elapsed), 0)
+ maxTimeout = max (min (idleTimeout, self.settings.timeout-elapsed), 0)
logger.debug ('timeout status',
uuid='49550447-37e3-49ff-9a73-34da1c3e5984',
maxTimeout=maxTimeout, elapsed=elapsed)
@@ -219,13 +219,13 @@ class SinglePageController:
self.processItem (item)
# if we stopped due to timeout, wait for remaining assets
- processQueue ()
+ processQueue (1)
for b in enabledBehavior:
for item in b.onfinish ():
self.processItem (item)
- processQueue ()
+ processQueue (1)
class RecursionPolicy:
""" Abstract recursion policy """