func (s *Service) registerHost(ctx context.Context, req *rpcscheduler.PeerTaskRequest) *resource.Host {
	rawHost := req.PeerHost
	host, ok := s.resource.HostManager().Load(rawHost.Uuid)
	if !ok {
		// Get scheduler cluster client config by manager
		var options []resource.HostOption
		if clientConfig, ok := s.dynconfig.GetSchedulerClusterClientConfig(); ok {
			options = append(options, resource.WithUploadLoadLimit(int32(clientConfig.LoadLimit)))
		}

		host = resource.NewHost(rawHost, options...)
		s.resource.HostManager().Store(host)
		host.Log.Info("create new host")
		return host
	}

	host.Log.Info("host already exists")
	return host
}
// registerHost creates a new host or reuses a previous host
registerHost creates a new host or reuses a previous host
// registerHost creates a new host or reuses a previous host
func (s *Service) registerHost(ctx context.Context, req *rpcscheduler.PeerTaskRequest) *resource.Host {
	rawHost := req.PeerHost
	host, ok := s.resource.HostManager().Load(rawHost.Uuid)
	if !ok {
		var options []resource.HostOption
		if clientConfig, ok := s.dynconfig.GetSchedulerClusterClientConfig(); ok {
			options = append(options, resource.WithUploadLoadLimit(int32(clientConfig.LoadLimit)))
		}
		host = resource.NewHost(rawHost, options...)
		s.resource.HostManager().Store(host)
		host.Log.Info("create new host")
		return host
	}
	host.Log.Info("host already exists")
	return host
}
func ( s * Service ) registerHost ( ctx context . Context , req * rpcscheduler . PeerTaskRequest ) * resource . Host { rawHost := req . PeerHost host , ok := s . resource . HostManager ( ) . Load ( rawHost . Uuid ) if ! ok { var options [ ] resource . HostOption if clientConfig , ok := s . dynconfig . GetSchedulerClusterClientConfig ( ) ; ok { options = append ( options , resource . WithUploadLoadLimit ( int32 ( clientConfig . LoadLimit ) ) ) } host = resource . NewHost ( rawHost , options ... ) s . resource . HostManager ( ) . Store ( host ) host . Log . Info ( " " ) return host } host . Log . Info ( " " ) return host }
registerHost creates a new host or reuses a previous host
registerHost creates a new host or reuses a previous host
// Get scheduler cluster client config by manager