mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-17 23:56:56 +00:00
Revert "GODT-1932: frontend is instantiated before bridge."
This reverts commit db2379e2fd.
This commit is contained in:
@ -87,8 +87,12 @@ func (s *Service) StopEventStream(ctx context.Context, _ *emptypb.Empty) (*empty
|
||||
|
||||
// SendEvent sends an event to the via the gRPC event stream.
|
||||
func (s *Service) SendEvent(event *StreamEvent) error {
|
||||
if s.eventStreamCh == nil { // nobody is connected to the event stream, we queue events
|
||||
s.queueEvent(event)
|
||||
s.eventQueueMutex.Lock()
|
||||
defer s.eventQueueMutex.Unlock()
|
||||
|
||||
if s.eventStreamCh == nil {
|
||||
// nobody is connected to the event stream, we queue events
|
||||
s.eventQueue = append(s.eventQueue, event)
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -163,14 +167,3 @@ func (s *Service) StartEventTest() error { //nolint:funlen
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *Service) queueEvent(event *StreamEvent) {
|
||||
s.eventQueueMutex.Lock()
|
||||
defer s.eventQueueMutex.Unlock()
|
||||
|
||||
if event.isInternetStatus() {
|
||||
s.eventQueue = append(filterOutInternetStatusEvents(s.eventQueue), event)
|
||||
} else {
|
||||
s.eventQueue = append(s.eventQueue, event)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user