Minor update for crawler

This commit is contained in:
stamparm 2013-04-30 18:32:46 +02:00
parent 887109a12d
commit 2bfdac5ebc

View File

@ -27,6 +27,7 @@ from thirdparty.oset.pyoset import oset
def crawl(target): def crawl(target):
try: try:
visited = set()
threadData = getCurrentThreadData() threadData = getCurrentThreadData()
threadData.shared.value = oset() threadData.shared.value = oset()
@ -37,6 +38,10 @@ def crawl(target):
with kb.locks.limit: with kb.locks.limit:
if threadData.shared.unprocessed: if threadData.shared.unprocessed:
current = threadData.shared.unprocessed.pop() current = threadData.shared.unprocessed.pop()
if current in visited:
continue
else:
visited.add(current)
else: else:
break break