func (s *Service) registerPeer(ctx context.Context, req *rpcscheduler.PeerTaskRequest, task *resource.Task, host *resource.Host) *resource.Peer {
	peer, loaded := s.resource.PeerManager().LoadOrStore(resource.NewPeer(req.PeerId, task, host))
	if !loaded {
		peer.Log.Info("create new peer")
	} else {
		peer.Log.Info("peer already exists")
	}

	return peer
}
// registerPeer creates a new peer or reuses a previous peer
registerPeer creates a new peer or reuses a previous peer
// registerPeer creates a new peer or reuses a previous peer
func (s *Service) registerPeer(ctx context.Context, req *rpcscheduler.PeerTaskRequest, task *resource.Task, host *resource.Host) *resource.Peer {
	peer, loaded := s.resource.PeerManager().LoadOrStore(resource.NewPeer(req.PeerId, task, host))
	if !loaded {
		peer.Log.Info("create new peer")
	} else {
		peer.Log.Info("peer already exists")
	}
	return peer
}
func ( s * Service ) registerPeer ( ctx context . Context , req * rpcscheduler . PeerTaskRequest , task * resource . Task , host * resource . Host ) * resource . Peer { peer , loaded := s . resource . PeerManager ( ) . LoadOrStore ( resource . NewPeer ( req . PeerId , task , host ) ) if ! loaded { peer . Log . Info ( " " ) } else { peer . Log . Info ( " " ) } return peer }
registerPeer creates a new peer or reuses a previous peer
registerPeer creates a new peer or reuses a previous peer