mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-12-25 01:02:17 +08:00
add flag to delay between domains (#101)
* New flag: -delay=x where x is ms to delay between domains. This feature will probably be removed some day when a better rate-limiting solution can be engineered.
This commit is contained in:
parent
70c9e529f7
commit
8cff3128ea
1 changed files with 4 additions and 0 deletions
4
main.go
4
main.go
|
@ -37,6 +37,8 @@ var domains = flag.String("domains", "", "Comma seperated list of domain names t
|
|||
|
||||
var interactive = flag.Bool("i", false, "Confirm or Exclude each correction before they run")
|
||||
|
||||
var delay = flag.Int64("d", 0, "delay between domains to avoid rate limits (in ms)")
|
||||
|
||||
func main() {
|
||||
log.SetFlags(log.LstdFlags | log.Lshortfile)
|
||||
flag.Parse()
|
||||
|
@ -233,6 +235,8 @@ func main() {
|
|||
}
|
||||
totalCorrections += len(corrections)
|
||||
anyErrors = printOrRunCorrections(corrections, command) || anyErrors
|
||||
|
||||
time.Sleep(time.Duration(*delay) * time.Millisecond)
|
||||
}
|
||||
default:
|
||||
log.Fatalf("Unknown command %s", command)
|
||||
|
|
Loading…
Reference in a new issue