godoc: periodically refresh package directory and search index.

R=adg, bradfitz
CC=golang-codereviews
https://golang.org/cl/55080043
This commit is contained in:
Brad Garcia 2014-01-28 09:30:23 -05:00
parent 8aae138131
commit 7ecad5bf71
1 changed files with 4 additions and 5 deletions

View File

@ -1483,12 +1483,11 @@ func (c *Corpus) RunIndexer() {
}
}
// repeatedly update the index when it goes out of date
// Repeatedly update the package directory tree and index.
// TODO(bgarcia): Use fsnotify to only update when notified of a filesystem change.
for {
if !c.indexUpToDate() {
// index possibly out of date - make a new one
c.UpdateIndex()
}
c.initFSTree()
c.UpdateIndex()
if c.IndexInterval < 0 {
return
}