mirror of
https://github.com/golang/go
synced 2024-11-22 02:04:40 -07:00
godoc: bring back "indexing in progress" message
A wrongly nested if prevented the message from appearing. Fixes #1420. R=r, r2 CC=golang-dev https://golang.org/cl/3987043
This commit is contained in:
parent
661bcb773b
commit
1b112c2297
@ -1172,7 +1172,8 @@ func lookup(query string) (result SearchResult) {
|
|||||||
lookupStr = prefix
|
lookupStr = prefix
|
||||||
}
|
}
|
||||||
|
|
||||||
if index, timestamp := searchIndex.get(); index != nil {
|
index, timestamp := searchIndex.get()
|
||||||
|
if index != nil {
|
||||||
// identifier search
|
// identifier search
|
||||||
index := index.(*Index)
|
index := index.(*Index)
|
||||||
result.Hit, result.Alt, err = index.Lookup(lookupStr)
|
result.Hit, result.Alt, err = index.Lookup(lookupStr)
|
||||||
@ -1188,12 +1189,16 @@ func lookup(query string) (result SearchResult) {
|
|||||||
const max = 10000 // show at most this many fulltext results
|
const max = 10000 // show at most this many fulltext results
|
||||||
result.Found, result.Textual = index.LookupRegexp(lookupRx, max+1)
|
result.Found, result.Textual = index.LookupRegexp(lookupRx, max+1)
|
||||||
result.Complete = result.Found <= max
|
result.Complete = result.Found <= max
|
||||||
|
}
|
||||||
|
|
||||||
// is the result accurate?
|
// is the result accurate?
|
||||||
if _, ts := fsModified.get(); timestamp < ts {
|
if _, ts := fsModified.get(); timestamp < ts {
|
||||||
|
// The index is older than the latest file system change
|
||||||
|
// under godoc's observation. Indexing may be in progress
|
||||||
|
// or start shortly (see indexer()).
|
||||||
result.Alert = "Indexing in progress: result may be inaccurate"
|
result.Alert = "Indexing in progress: result may be inaccurate"
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user