fix(GODT-2500): Recover in deferred function.

This commit is contained in:
Jakub
2023-04-04 15:27:03 +02:00
parent fd100eecc2
commit 7330406752
18 changed files with 103 additions and 85 deletions

View File

@ -20,6 +20,7 @@ package grpc
import (
"context"
"github.com/ProtonMail/gluon/async"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/emptypb"
@ -49,7 +50,7 @@ func (s *Service) RunEventStream(request *EventStreamRequest, server Bridge_RunE
// if events occurred before streaming started, they've been queued. Now that the stream channel is available
// we can flush the queued
go func() {
defer s.handlePanic()
defer async.HandlePanic(s.panicHandler)
s.eventQueueMutex.Lock()
defer s.eventQueueMutex.Unlock()