cmd/godoc: add -index_interval

Updates golang/go#9996.

Change-Id: I6112b1c32832aaa6604b096cfe7a8833f092b17a
Reviewed-on: https://go-review.googlesource.com/7031
Reviewed-by: Andrew Gerrand <adg@golang.org>
This commit is contained in:
Péter Surányi 2015-03-06 20:24:21 +09:00 committed by Andrew Gerrand
parent bdcea2c1b3
commit c327a7c00b
1 changed files with 2 additions and 0 deletions

View File

@ -97,6 +97,7 @@ var (
// search index // search index
indexEnabled = flag.Bool("index", false, "enable 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") 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") 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") 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.IndexFiles = *indexFiles
corpus.IndexThrottle = *indexThrottle corpus.IndexThrottle = *indexThrottle
corpus.IndexInterval = *indexInterval
if *writeIndex { if *writeIndex {
corpus.IndexThrottle = 1.0 corpus.IndexThrottle = 1.0
corpus.IndexEnabled = true corpus.IndexEnabled = true