From c327a7c00bfa16aba015bc8084b40e3d99f0a213 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Sur=C3=A1nyi?= Date: Fri, 6 Mar 2015 20:24:21 +0900 Subject: [PATCH] cmd/godoc: add -index_interval Updates golang/go#9996. Change-Id: I6112b1c32832aaa6604b096cfe7a8833f092b17a Reviewed-on: https://go-review.googlesource.com/7031 Reviewed-by: Andrew Gerrand --- cmd/godoc/main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/godoc/main.go b/cmd/godoc/main.go index 03d29d06..42e95ab1 100644 --- a/cmd/godoc/main.go +++ b/cmd/godoc/main.go @@ -97,6 +97,7 @@ var ( // search index indexEnabled = flag.Bool("index", false, "enable search index") indexFiles = flag.String("index_files", "", "glob pattern specifying index files; if not empty, the index is read from these files in sorted order") + indexInterval = flag.Duration("index_interval", 0, "interval of indexing; 0 for default (5m), negative to only index once at startup") maxResults = flag.Int("maxresults", 10000, "maximum number of full text search results shown") indexThrottle = flag.Float64("index_throttle", 0.75, "index throttle value; 0.0 = no time allocated, 1.0 = full throttle") @@ -219,6 +220,7 @@ func main() { } corpus.IndexFiles = *indexFiles corpus.IndexThrottle = *indexThrottle + corpus.IndexInterval = *indexInterval if *writeIndex { corpus.IndexThrottle = 1.0 corpus.IndexEnabled = true