Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2bfdac5

Browse files
committed
Minor update for crawler
1 parent 887109a commit 2bfdac5

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

lib/utils/crawler.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
def crawl(target):
2929
try:
30+
visited = set()
3031
threadData = getCurrentThreadData()
3132
threadData.shared.value = oset()
3233

@@ -37,6 +38,10 @@ def crawlThread():
3738
with kb.locks.limit:
3839
if threadData.shared.unprocessed:
3940
current = threadData.shared.unprocessed.pop()
41+
if current in visited:
42+
continue
43+
else:
44+
visited.add(current)
4045
else:
4146
break
4247

0 commit comments

Comments
 (0)