Increase buffer of events channel (#13329)

This commit is contained in:
Radosław Kapka 2023-12-13 16:37:45 +01:00 committed by GitHub
parent 175c484c44
commit ea59b1ec71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,6 +48,8 @@ const (
const topicDataMismatch = "Event data type %T does not correspond to event topic %s"
const chanBuffer = 1000
var casesHandled = map[string]bool{
HeadTopic: true,
BlockTopic: true,
@ -90,9 +92,9 @@ func (s *Server) StreamEvents(w http.ResponseWriter, r *http.Request) {
}
// Subscribe to event feeds from information received in the beacon node runtime.
opsChan := make(chan *feed.Event, 1)
opsChan := make(chan *feed.Event, chanBuffer)
opsSub := s.OperationNotifier.OperationFeed().Subscribe(opsChan)
stateChan := make(chan *feed.Event, 1)
stateChan := make(chan *feed.Event, chanBuffer)
stateSub := s.StateNotifier.StateFeed().Subscribe(stateChan)
defer opsSub.Unsubscribe()
defer stateSub.Unsubscribe()