Skip to content

Commit

Permalink
update: threading num fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
Esonhugh committed Jan 16, 2025
1 parent 903a9c2 commit bbeaed7
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,6 @@ var RootCmd = &cobra.Command{
// Set pkg global config
pkg.Zone = Opts.Zone

// debug print option data
opt, _ := json.MarshalIndent(Opts, "", " ")
log.Tracef("Opts: %v", string(opt))

if Opts.DnsServer != "" {
pkg.NetResolver = pkg.WarpDnsServer(Opts.DnsServer)
}
Expand All @@ -99,6 +95,10 @@ var RootCmd = &cobra.Command{
for _, rules := range Opts.FilterStrings {
pkg.NetResolver.SetContainsFilter(rules)
}

if !Opts.MultiThreadingMode {
Opts.ThreadingNum = 1
}
// Check if current environment is a kubernetes cluster
// If the command is whereisdns, which means DNS is not sure , so skip this check!
// If SkipKubeDNSCheck is true, skip this check!
Expand All @@ -112,6 +112,10 @@ var RootCmd = &cobra.Command{
} else {
log.Tracef("kubernetes environment checking bypassed")
}

// debug print option data
opt, _ := json.MarshalIndent(Opts, "", " ")
log.Tracef("Opts: %v", string(opt))
},
Run: func(cmd *cobra.Command, args []string) {
_ = cmd.Help()
Expand Down

0 comments on commit bbeaed7

Please sign in to comment.