AlexStocks commented on code in PR #914:
URL: https://github.com/apache/dubbo-go-samples/pull/914#discussion_r2326453659


##########
config_center/zookeeper/go-client/cmd/main.go:
##########
@@ -40,71 +40,112 @@ import (
 )
 
 func main() {
-       _ = writeRuleToConfigCenter()
+       // write configuration to config center
+       if err := writeRuleToConfigCenter(); err != nil {
+               logger.Errorf("Failed to write config to config center: %v", 
err)
+               panic(err)
+       }
+       logger.Info("Successfully wrote config to ZooKeeper")
 
-       time.Sleep(time.Second * 10)
+       // wait for config write to finish
+       time.Sleep(time.Second * 3)

Review Comment:
   能否在 config center 加个同步等待接口,确切知道配置完毕,然后再往下推进。这样的 sleep,不优雅不说,咱们的 samples 
给出的就是最佳实践,用户也会这么干。



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