From c7a4ff975c63cfd6d19eeb5bc56c477e0fe8f906 Mon Sep 17 00:00:00 2001 From: Adam Mathes Date: Sat, 7 Jul 2018 10:57:09 -0700 Subject: fix minutes flag --- main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 6908ff9..4c35153 100644 --- a/main.go +++ b/main.go @@ -89,13 +89,16 @@ func main() { return } - go backgroundCrawl(minutes) + go backgroundCrawl(config.Config.CrawlMinutes) vlog.Printf("starting web server at 127.0.0.1:%d\n", config.Config.Port) web.Serve() } func backgroundCrawl(minutes int) { + if minutes < 1 { + return + } for { time.Sleep(time.Minute * time.Duration(minutes)) crawler.Crawl() -- cgit v1.2.3