Skip to content

Commit

Permalink
Merge pull request #8 from pppontusw/no-refetch-same-page
Browse files Browse the repository at this point in the history
Don't rescrape the same page
  • Loading branch information
pppontusw authored May 9, 2024
2 parents 402a8fc + c3955a1 commit 417dd38
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/scraper/scrapers.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ func (bs *BaseScraper) Scrape(maxWorkers int) ([]models.Product, error) {
break // Exit loop if there's no next URL
}

if nextURL == currentURL {
break // Exit loop if the next URL is the same as the current URL
}

currentURL = nextURL
}
}(url)
Expand Down

0 comments on commit 417dd38

Please sign in to comment.