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



##########
File path: datasource/mongo/ms.go
##########
@@ -1404,13 +1404,80 @@ func getServiceDetailUtil(ctx context.Context, mgs 
*model.Service, countOnly boo
 }
 
 // Instance management
-func (ds *DataSource) RegisterInstance(ctx context.Context, request 
*discovery.RegisterInstanceRequest) (*discovery.RegisterInstanceResponse, 
error) {
+func (ds *DataSource) RegisterInstance(ctx context.Context,
+       request *discovery.RegisterInstanceRequest) 
(*discovery.RegisterInstanceResponse, error) {
+
+       isCustomID := true
+
+       if len(request.Instance.InstanceId) == 0 {
+               isCustomID = false
+               request.Instance.InstanceId = 
uuid.Generator().GetInstanceID(ctx)
+       }
+
+       if isFastRegisterEnabled {
+               // fast register, just add instance to channel and batch 
register them later
+               event := &InstanceRegisterEvent{ctx, request, isCustomID, 0}
+               GetFastRegisterInstanceService().AddEvent(event)

Review comment:
       1. 需要在配置项中说明功能实现机制
   2. 需要提供一个readme,说明fast regsiter的正确使用方法
   3. 在主Readme增加features,关联资料




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