aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main.go5
1 files changed, 4 insertions, 1 deletions
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()