aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Mathes <adam@trenchant.org>2018-07-07 10:57:09 -0700
committerAdam Mathes <adam@trenchant.org>2018-07-07 10:57:09 -0700
commitc7a4ff975c63cfd6d19eeb5bc56c477e0fe8f906 (patch)
tree804e1fe7ad48519114e8b52f759725eabf9bfeb3
parente319e1062d62ce2f5965f191e0e30802b0bd97fd (diff)
downloadneko-c7a4ff975c63cfd6d19eeb5bc56c477e0fe8f906.tar.gz
neko-c7a4ff975c63cfd6d19eeb5bc56c477e0fe8f906.tar.bz2
neko-c7a4ff975c63cfd6d19eeb5bc56c477e0fe8f906.zip
fix minutes flag
-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()