mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-22 03:30:35 +00:00
No timeout for API events (#10611)
* no event timeout * Revert "Auxiliary commit to revert individual files from 1bfe8327ed02104432cc6bde09ac6afc8fb21f62" This reverts commit 5f7aa10e5bc0bc18a414efdf425ae90cbcf08b99. * proper solution * comment fix Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
parent
d4fa490dec
commit
1d587c0e95
@ -186,6 +186,7 @@ func writeSSZResponseHeaderAndBody(grpcResp *http.Response, w http.ResponseWrite
|
||||
|
||||
func handleEvents(m *apimiddleware.ApiProxyMiddleware, _ apimiddleware.Endpoint, w http.ResponseWriter, req *http.Request) (handled bool) {
|
||||
sseClient := sse.NewClient("http://" + m.GatewayAddress + "/internal" + req.URL.RequestURI())
|
||||
sseClient.Headers["Grpc-Timeout"] = "0S"
|
||||
eventChan := make(chan *sse.Event)
|
||||
|
||||
// We use grpc-gateway as the server side of events, not the sse library.
|
||||
@ -212,8 +213,8 @@ func receiveEvents(eventChan <-chan *sse.Event, w http.ResponseWriter, req *http
|
||||
case msg := <-eventChan:
|
||||
var data interface{}
|
||||
|
||||
// The message's event comes to us with trailing whitespace. Remove it here for
|
||||
// ease of future procesing.
|
||||
// The message's event comes to us with trailing whitespace. Remove it here for
|
||||
// ease of future processing.
|
||||
msg.Event = bytes.TrimSpace(msg.Event)
|
||||
|
||||
switch string(msg.Event) {
|
||||
|
Loading…
Reference in New Issue
Block a user