robocanic commented on code in PR #1314:
URL: https://github.com/apache/dubbo-admin/pull/1314#discussion_r2296881517


##########
pkg/config/app/admin.go:
##########
@@ -50,16 +50,26 @@ var _ = &AdminConfig{}
 
 func (c *AdminConfig) Sanitize() {
        c.Engine.Sanitize()
-       c.Discovery.Sanitize()
+       for _, d := range c.Discovery {
+               d.Sanitize()
+       }
        c.Store.Sanitize()
        c.Console.Sanitize()
        c.Diagnostics.Sanitize()
 }
 
 func (c *AdminConfig) PostProcess() error {
+       discoveryPostProcess := func() error {
+               for _, d := range c.Discovery {
+                       if err := d.PostProcess(); err != nil {
+                               return err
+                       }
+               }
+               return nil
+       }
        return multierr.Combine(
                c.Engine.PostProcess(),
-               c.Discovery.PostProcess(),
+               discoveryPostProcess(),

Review Comment:
   It' designed to fail fast, because if a config of dsicovery is invalid, the 
start and run process would return err either.



-- 
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