Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
g0ldencybersec committed Apr 30, 2024
1 parent 704a6fb commit 5ad3dbf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ func main() {

flag.Parse()

//need at least 100
if args.Concurrency < 100 {
args.Concurrency = 100
}

if args.Help {
fmt.Println(scrapeUsage)
flag.PrintDefaults()
Expand Down
4 changes: 2 additions & 2 deletions pkg/scrape/scrape.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ func RunScrape(args types.ScrapeArgs) {

inputChannel := make(chan string)
resultChannel := make(chan types.Result)
outputChannel := make(chan string, 1000)
outputChannel := make(chan string, args.Concurrency/10)

// Create and start the worker pool
workerPool := workers.NewWorkerPool(args.Concurrency, dialer, inputChannel, resultChannel)
workerPool.Start()

// Create and start the results worker pool
resultsWorkerPool := workers.NewResultWorkerPool(50, resultChannel, outputChannel) // Adjust the size as needed
resultsWorkerPool := workers.NewResultWorkerPool(args.Concurrency/100, resultChannel, outputChannel) // Adjust the size as needed
resultsWorkerPool.Start(args)

// Handle input feeding
Expand Down

0 comments on commit 5ad3dbf

Please sign in to comment.