mfordjody commented on code in PR #892:
URL: https://github.com/apache/dubbo-go-pixiu/pull/892#discussion_r3004231672


##########
pkg/hotreload/route_reloader.go:
##########
@@ -56,16 +54,44 @@ func (r *RouteReloader) CheckUpdate(oldConfig, newConfig 
*model.Bootstrap) bool
 
 // HotReload applies the new route configuration.
 func (r *RouteReloader) HotReload(oldConfig, newConfig *model.Bootstrap) error 
{
-       oldRoutes := extractRoutes(oldConfig)
-       newRoutes := extractRoutes(newConfig)
+       logger.Info("Starting route hot reload")
+
+       srv := server.GetServer()
+       if srv == nil {
+               logger.Error("Server instance is nil")
+               return errors.New("server instance is nil")
+       }
+       logger.Info("Got server instance")
+
+       logger.Info("Reinitializing server components...")
+
+       listenerManager := srv.GetListenerManager()
+       if listenerManager == nil {
+               logger.Error("Listener manager is nil")
+               return errors.New("listener manager is nil")
+       }
+
+       refreshed := 0
+       for _, listener := range newConfig.StaticResources.Listeners {
+               logger.Infof("Refreshing listener: name=%s, protocol=%s", 
listener.Name, listener.ProtocolStr)
+
+               srv.GetRouterManager().ClearRouterListeners()

Review Comment:
   done.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to