tianxiaoliang commented on a change in pull request #759:
URL:
https://github.com/apache/servicecomb-service-center/pull/759#discussion_r533099236
##########
File path: datasource/mongo/ms.go
##########
@@ -1346,56 +1373,865 @@ func SchemaExist(ctx context.Context, serviceID,
schemaID string) (bool, error)
// Instance management
func (ds *DataSource) RegisterInstance(ctx context.Context, request
*pb.RegisterInstanceRequest) (*pb.RegisterInstanceResponse, error) {
- return &pb.RegisterInstanceResponse{}, nil
+ remoteIP := util.GetIPFromContext(ctx)
+ instance := request.Instance
+
+ // 允许自定义 id
+ if len(instance.InstanceId) > 0 {
+ resp, err := ds.Heartbeat(ctx, &pb.HeartbeatRequest{
+ InstanceId: instance.InstanceId,
+ ServiceId: instance.ServiceId,
+ })
+ if resp == nil {
Review comment:
要先判断err
----------------------------------------------------------------
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]