mirror of https://github.com/perkeep/perkeep.git
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:
parent
fc619464df
commit
7d326336cf
|
@ -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...)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue