Add new config - number_of_hosts

This commit is contained in:
Ben Adrian Sarmiento
2024-06-17 17:27:07 +02:00
parent f33c2411e0
commit ad06d8fea3
3 changed files with 39 additions and 39 deletions

View File

@@ -86,7 +86,7 @@ func MainApp(configPath string) {
log.Named("unrestrict_client"),
)
hosts := repo.GetOptimalHosts(config.ShouldForceIPv6())
hosts := repo.GetOptimalHosts(config.GetNumberOfHosts(), config.ShouldForceIPv6())
zurglog.Debugf("Optimal hosts (%d): %v", len(hosts), hosts)
downloadClient := http.NewHTTPClient(
@@ -99,7 +99,7 @@ func MainApp(configPath string) {
log.Named("download_client"),
)
workerPool, err := ants.NewPool(config.GetNumOfWorkers())
workerPool, err := ants.NewPool(config.GetNumberOfWorkers())
if err != nil {
zurglog.Errorf("Failed to create worker pool: %v", err)
os.Exit(1)