From 8cff3128eaa9c3af02073c16100fcd18fcc50402 Mon Sep 17 00:00:00 2001 From: rbelnap Date: Sat, 5 Aug 2017 10:49:21 -0400 Subject: [PATCH] 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. --- main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.go b/main.go index 91cb5b275..7b1c84e96 100644 --- a/main.go +++ b/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)