Document web interface request timeout.

This commit is contained in:
Bastian Kleineidam 2012-04-21 12:34:34 +02:00
parent e679efae7a
commit d423a8b1af
3 changed files with 11 additions and 4 deletions

View file

@ -7,3 +7,9 @@ The web interface can be configured with
If you want to access to web interface from other
computers, add their IP addresses in the file
/etc/apache2/conf.d/linkchecker
There is a default maximum check time of 5 minutes
per request. After that, checking will be aborted.
If you want to change this limit, look in the file
/usr/share/pyshared/linkcheck/lc_cgi.py and adjust
the variable MAX_REQUEST_SECONDS.

View file

@ -1 +1 @@
debian/README.Debian
debian/README.Debian.web

View file

@ -29,6 +29,9 @@ from . import configuration, strformat, checker, director, \
add_intern_pattern, get_link_pat, init_i18n, url as urlutil
from .decorators import synchronized
# 5 minutes timeout for requests
MAX_REQUEST_SECONDS = 300
def application(environ, start_response):
"""WSGI interface: start an URL check."""
@ -148,15 +151,13 @@ def start_check (aggregate, out):
t.start()
# time to wait for new data
sleep_seconds = 2
# 5 minutes timeout
max_seconds = 300
# current running time
run_seconds = 0
while not aggregate.is_finished():
yield out.get_data()
time.sleep(sleep_seconds)
run_seconds += sleep_seconds
if run_seconds > max_seconds:
if run_seconds > MAX_REQUEST_SECONDS:
director.abort(aggregate)
break
yield out.get_data()