mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-20 01:06:45 +00:00
Move keepalive out of mgm pkg
This commit is contained in:
@@ -40,6 +40,7 @@ import (
|
||||
"google.golang.org/grpc/keepalive"
|
||||
|
||||
"github.com/netbirdio/netbird/encryption"
|
||||
grpcKeepAlive "github.com/netbirdio/netbird/keepalive"
|
||||
mgmtProto "github.com/netbirdio/netbird/management/proto"
|
||||
)
|
||||
|
||||
@@ -207,7 +208,8 @@ var (
|
||||
return fmt.Errorf("failed creating gRPC API handler: %v", err)
|
||||
}
|
||||
|
||||
ka := server.NewKeepAlive()
|
||||
ka := grpcKeepAlive.NewKeepAlive(&mgmtProto.Empty{})
|
||||
defer ka.Stop()
|
||||
sInterc := grpc.StreamInterceptor(ka.StreamInterceptor())
|
||||
uInterc := grpc.UnaryInterceptor(ka.UnaryInterceptor())
|
||||
gRPCOpts = append(gRPCOpts, sInterc, uInterc)
|
||||
|
||||
Reference in New Issue
Block a user