mirror of
https://github.com/terorie/od-database-crawler.git
synced 2025-12-13 15:19:03 +00:00
Hash links
This commit is contained in:
10
worker.go
10
worker.go
@@ -86,15 +86,17 @@ func DoJob(job *Job, f *File) (newJobs []Job, err error) {
|
||||
}
|
||||
|
||||
for _, link := range links {
|
||||
uriStr := link.String()
|
||||
// Skip already queued links
|
||||
//if _, old := job.OD.Scanned.LoadOrStore(link, true); old {
|
||||
// continue
|
||||
//}
|
||||
linkHash := HashString(uriStr)
|
||||
if job.OD.LoadOrStoreKey(&linkHash) {
|
||||
continue
|
||||
}
|
||||
job.OD.Wait.Add(1)
|
||||
newJobs = append(newJobs, Job{
|
||||
OD: job.OD,
|
||||
Uri: link,
|
||||
UriStr: link.String(),
|
||||
UriStr: uriStr,
|
||||
Fails: 0,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user