robotLJW commented on a change in pull request #953:
URL: 
https://github.com/apache/servicecomb-service-center/pull/953#discussion_r617232839



##########
File path: datasource/mongo/fast_register_config.go
##########
@@ -0,0 +1,25 @@
+package mongo
+
+import (
+       "sync"
+
+       "github.com/apache/servicecomb-service-center/server/config"
+)
+
+var (
+       configOnce    sync.Once
+       fastRegConfig FastRegConfig
+)
+
+type FastRegConfig struct {
+       enable    bool
+       queueSize int
+}
+
+func Configuration() *FastRegConfig {
+       configOnce.Do(func() {
+               fastRegConfig.enable = 
config.GetBool("registry.mongo.fastRegister.enable", false)
+               fastRegConfig.queueSize = 
config.GetInt("registry.mongo.fastRegister.queueSize", 500000)

Review comment:
       50000还是定义成常量会比较好,魔鬼数字




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

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


Reply via email to