Skip to content

Commit

Permalink
refactor(runner): adjust max-host-error if gt concurrency
Browse files Browse the repository at this point in the history
Signed-off-by: Dwi Siswanto <git@dw1.io>
  • Loading branch information
dwisiswant0 committed Sep 13, 2024
1 parent f8e9bcd commit b7c7918
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion internal/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,17 @@ func (r *Runner) RunEnumeration() error {
}

if r.options.ShouldUseHostError() {
cache := hosterrorscache.New(r.options.MaxHostError, hosterrorscache.DefaultMaxHostsCount, r.options.TrackError)
maxHostError := r.options.MaxHostError
if r.options.TemplateThreads > maxHostError {
gologger.Print().Msgf("[%v] The concurrency value is higher than max-host-error", r.colorizer.BrightYellow("WRN"))
gologger.Info().Msg("Adjusting max-host-error to the concurrency value")

maxHostError = r.options.TemplateThreads
}

cache := hosterrorscache.New(maxHostError, hosterrorscache.DefaultMaxHostsCount, r.options.TrackError)
cache.SetVerbose(r.options.Verbose)

r.hostErrors = cache
executorOpts.HostErrorsCache = cache
}
Expand Down

0 comments on commit b7c7918

Please sign in to comment.