mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-18 16:26:38 +00:00
Added s.GRPCServer() call before the afterInit
This commit is contained in:
@@ -140,8 +140,11 @@ func (s *BaseServer) Start(ctx context.Context) error {
|
|||||||
go metricsWorker.Run(srvCtx)
|
go metricsWorker.Run(srvCtx)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run afterInit hooks before starting any servers
|
// Eagerly create the gRPC server so that all AfterInit hooks are registered
|
||||||
// This allows registering additional gRPC services (e.g., Signal) before Serve() is called
|
// before we iterate them. Lazy creation after the loop would miss hooks
|
||||||
|
// registered during GRPCServer() construction (e.g., SetProxyManager).
|
||||||
|
s.GRPCServer()
|
||||||
|
|
||||||
for _, fn := range s.afterInit {
|
for _, fn := range s.afterInit {
|
||||||
if fn != nil {
|
if fn != nil {
|
||||||
fn(s)
|
fn(s)
|
||||||
|
|||||||
Reference in New Issue
Block a user