search: remove broken websocket status optimization.

It was breaking the websocket integration test. We still need to
compute the last status message even if nobody is currently connected,
because when a websocket connection does arrive, we need to send the
last commputed status message.

Change-Id: Icea0fcc69941aa6249d32f0a4ef4ec03bdfb1e20
This commit is contained in:
Brad Fitzpatrick 2016-04-26 09:29:39 -07:00
parent fc619464df
commit 7d326336cf
2 changed files with 1 additions and 3 deletions

View File

@ -72,9 +72,6 @@ func (h *wsHub) run() {
for {
select {
case st := <-h.statusUpdate:
if len(h.conns) == 0 {
continue
}
const prefix = `{"tag":"_status","status":`
lastStatusMsg = make([]byte, 0, len(prefix)+len(st)+1)
lastStatusMsg = append(lastStatusMsg, prefix...)

View File

@ -72,6 +72,7 @@ func TestWebsocketQuery(t *testing.T) {
if err != nil {
t.Fatalf("Dial: %v", err)
}
defer c.Close()
wc, _, err := websocket.NewClient(c, &url.URL{Host: w.Addr(), Path: w.SearchHandlerPath() + "ws"}, nil, bufSize, bufSize)
check(err)