mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-20 22:31:00 +00:00
Document web interface request timeout.
This commit is contained in:
parent
e679efae7a
commit
d423a8b1af
3 changed files with 11 additions and 4 deletions
|
|
@ -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.
|
||||
2
debian/linkchecker-web.docs
vendored
2
debian/linkchecker-web.docs
vendored
|
|
@ -1 +1 @@
|
|||
debian/README.Debian
|
||||
debian/README.Debian.web
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in a new issue