use timeout for get() method, return thread object

git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@3286 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
calvin 2006-05-23 16:33:09 +00:00
parent a1905bdb22
commit eaf1fd4ba1

View file

@ -40,6 +40,7 @@ def start_thread (target, *args):
t = threading.Thread(target=lambda: check_target(target, args))
t.setDaemon(True)
t.start()
return t
class Aggregate (object):
@ -71,7 +72,11 @@ class Aggregate (object):
break
def check_url (self):
url_data = self.urlqueue.get()
try:
url_data = self.urlqueue.get(timeout=1)
except linkcheck.cache.urlqueue.Timeout:
time.sleep(1)
return
if url_data is not None:
try:
if url_data.url is None: