fix agent connect

This commit is contained in:
naiba
2024-10-22 23:44:50 +08:00
parent f99edfd7bd
commit c4011934f7
7 changed files with 60 additions and 64 deletions

View File

@@ -1,7 +1,7 @@
package rpc
import (
"net"
"net/http"
"google.golang.org/grpc"
@@ -11,11 +11,11 @@ import (
"github.com/naiba/nezha/service/singleton"
)
func ServeRPC(l net.Listener) {
func ServeRPC() http.Handler {
server := grpc.NewServer()
rpcService.NezhaHandlerSingleton = rpcService.NewNezhaHandler()
pb.RegisterNezhaServiceServer(server, rpcService.NezhaHandlerSingleton)
server.Serve(l)
return server
}
func DispatchTask(serviceSentinelDispatchBus <-chan model.Monitor) {