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:
rbelnap 2017-08-05 10:49:21 -04:00 committed by Tom Limoncelli
parent 70c9e529f7
commit 8cff3128ea

View file

@ -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)