mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-03 08:37:37 +00:00
Increase buffer of events channel (#13329)
This commit is contained in:
parent
175c484c44
commit
ea59b1ec71
@ -48,6 +48,8 @@ const (
|
|||||||
|
|
||||||
const topicDataMismatch = "Event data type %T does not correspond to event topic %s"
|
const topicDataMismatch = "Event data type %T does not correspond to event topic %s"
|
||||||
|
|
||||||
|
const chanBuffer = 1000
|
||||||
|
|
||||||
var casesHandled = map[string]bool{
|
var casesHandled = map[string]bool{
|
||||||
HeadTopic: true,
|
HeadTopic: true,
|
||||||
BlockTopic: 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.
|
// 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)
|
opsSub := s.OperationNotifier.OperationFeed().Subscribe(opsChan)
|
||||||
stateChan := make(chan *feed.Event, 1)
|
stateChan := make(chan *feed.Event, chanBuffer)
|
||||||
stateSub := s.StateNotifier.StateFeed().Subscribe(stateChan)
|
stateSub := s.StateNotifier.StateFeed().Subscribe(stateChan)
|
||||||
defer opsSub.Unsubscribe()
|
defer opsSub.Unsubscribe()
|
||||||
defer stateSub.Unsubscribe()
|
defer stateSub.Unsubscribe()
|
||||||
|
Loading…
Reference in New Issue
Block a user