Skip to content

Commit

Permalink
fix(runtime): debug server not starting due to blocking grpc serve (#275
Browse files Browse the repository at this point in the history
)

* fix(runtime): debug server not starting due to blocking grpc serve

* Update signer/remote_signer_grpc_server.go
  • Loading branch information
agouin authored Jul 10, 2024
1 parent 29bfe6d commit 735808b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion signer/remote_signer_grpc_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package signer

import (
"context"
"fmt"
"net"
"time"

Expand Down Expand Up @@ -50,7 +51,14 @@ func (s *RemoteSignerGRPCServer) OnStart() error {
s.server = grpc.NewServer()
proto.RegisterRemoteSignerServer(s.server, s)
reflection.Register(s.server)
return s.server.Serve(sock)
go s.serve(sock)
return nil
}

func (s *RemoteSignerGRPCServer) serve(sock net.Listener) {
if err := s.server.Serve(sock); err != nil {
panic(fmt.Errorf("remote signer grpc server: %w", err))
}
}

func (s *RemoteSignerGRPCServer) OnStop() {
Expand Down

0 comments on commit 735808b

Please sign in to comment.