mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-04 23:20:34 +00:00
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:
parent
afd866456a
commit
0d9828002b
2 changed files with 4 additions and 0 deletions
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -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."""
|
||||
|
|
|
|||
Loading…
Reference in a new issue