func (s *Service) ReportPeerResult(ctx context.Context, req *rpcscheduler.PeerResult) error {
	peer, ok := s.resource.PeerManager().Load(req.PeerId)
	if !ok {
		logger.Errorf("report peer result: peer %s is not exists", req.PeerId)
		return dferrors.Newf(base.Code_SchedPeerNotFound, "peer %s not found", req.PeerId)
	}

	peer.Log.Infof("report peer result request: %#v", req)
	if !req.Success {
		if peer.FSM.Is(resource.PeerStateBackToSource) {
			s.handleTaskFail(ctx, peer.Task)
		}
		s.handlePeerFail(ctx, peer)
		return nil
	}

	if peer.FSM.Is(resource.PeerStateBackToSource) {
		s.handleTaskSuccess(ctx, peer.Task, req)
	}
	s.handlePeerSuccess(ctx, peer)
	return nil
}
// ReportPeerResult handles peer result reported by dfdaemon
ReportPeerResult handles peer result reported by dfdaemon
// ReportPeerResult handles peer result reported by dfdaemon
func (s *Service) ReportPeerResult(ctx context.Context, req *rpcscheduler.PeerResult) error {
	peer, ok := s.resource.PeerManager().Load(req.PeerId)
	if !ok {
		logger.Errorf("report peer result: peer %s is not exists", req.PeerId)
		return dferrors.Newf(base.Code_SchedPeerNotFound, "peer %s not found", req.PeerId)
	}
	peer.Log.Infof("report peer result request: %#v", req)
	if !req.Success {
		if peer.FSM.Is(resource.PeerStateBackToSource) {
			s.handleTaskFail(ctx, peer.Task)
		}
		s.handlePeerFail(ctx, peer)
		return nil
	}
	if peer.FSM.Is(resource.PeerStateBackToSource) {
		s.handleTaskSuccess(ctx, peer.Task, req)
	}
	s.handlePeerSuccess(ctx, peer)
	return nil
}
func ( s * Service ) ReportPeerResult ( ctx context . Context , req * rpcscheduler . PeerResult ) error { peer , ok := s . resource . PeerManager ( ) . Load ( req . PeerId ) if ! ok { logger . Errorf ( " " , req . PeerId ) return dferrors . Newf ( base . Code_SchedPeerNotFound , " " , req . PeerId ) } peer . Log . Infof ( " " , req ) if ! req . Success { if peer . FSM . Is ( resource . PeerStateBackToSource ) { s . handleTaskFail ( ctx , peer . Task ) } s . handlePeerFail ( ctx , peer ) return nil } if peer . FSM . Is ( resource . PeerStateBackToSource ) { s . handleTaskSuccess ( ctx , peer . Task , req ) } s . handlePeerSuccess ( ctx , peer ) return nil }
ReportPeerResult handles peer result reported by dfdaemon
ReportPeerResult handles peer result reported by dfdaemon