Added flag to stop checking from another thread.

git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@3970 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
calvin 2009-02-19 08:15:32 +00:00
parent afd866456a
commit 0d9828002b
2 changed files with 4 additions and 0 deletions

View file

@ -62,6 +62,9 @@ def check_url (aggregate):
aggregate.remove_stopped_threads()
if not aggregate.threads:
break
if aggregate.wanted_stop:
# some other thread wants us to stop
raise KeyboardInterrupt
def interrupt (aggregate):

View file

@ -39,6 +39,7 @@ class Aggregate (object):
self.logger = logger.Logger(config)
self.threads = []
self.last_w3_call = 0
self.wanted_stop = False
def start_threads (self):
"""Spawn threads for URL checking and status printing."""