search: add a forgotten Cancel.

Funny, because this one line is why I finally went and added the Context type
and started plumbing it through lots of stuff.

Change-Id: Ie419362048a485629e79725de9297fe485430d4a
This commit is contained in:
Brad Fitzpatrick 2013-12-07 08:49:30 -08:00
parent e27a1dd019
commit 1e1183a8bf
1 changed files with 1 additions and 0 deletions

View File

@ -310,6 +310,7 @@ func (h *Handler) Query(rawq *SearchQuery) (*SearchResult, error) {
Blob: meta.Ref,
})
if q.Limit > 0 && len(res.Blobs) == q.Limit && q.candidatesAreSorted(s) {
sendCtx.Cancel()
break
}
}