From 7ecad5bf71b97ddb21895a72665e412278b8e493 Mon Sep 17 00:00:00 2001 From: Brad Garcia Date: Tue, 28 Jan 2014 09:30:23 -0500 Subject: [PATCH] godoc: periodically refresh package directory and search index. R=adg, bradfitz CC=golang-codereviews https://golang.org/cl/55080043 --- godoc/index.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/godoc/index.go b/godoc/index.go index d5332d2384..d3d5eaeeb5 100644 --- a/godoc/index.go +++ b/godoc/index.go @@ -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 }