There is no need to send heartbeat when registering an instance
@@ -1956,17 +1956,6 @@ func registryInstance(ctx context.Context, request *discovery.RegisterInstanceRe
log.Info(fmt.Sprintf("register instance %s, instanceID %s, operator %s",
instanceFlag, insertRes.InsertedID, remoteIP))
- heartbeatRequest := discovery.HeartbeatRequest{
- ServiceId: instance.ServiceId,
- InstanceId: instance.InstanceId,
- }
- aliveErr := KeepAliveLease(ctx, &heartbeatRequest)
- if aliveErr != nil {
- log.Error(fmt.Sprintf("failed to send heartbeat after registering instance, instance %s operator %s", instanceFlag, remoteIP), err)
- return &discovery.RegisterInstanceResponse{
- Response: discovery.CreateResponseWithSCErr(aliveErr),
- }, err
- }
return &discovery.RegisterInstanceResponse{
Response: discovery.CreateResponse(discovery.ResponseSuccess, "Register service instance successfully."),
InstanceId: instanceID,
