mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-18 21:31:00 +00:00
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:
parent
a1905bdb22
commit
eaf1fd4ba1
1 changed files with 6 additions and 1 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue