func (s *Server) RegisterPeerTask(ctx context.Context, req *scheduler.PeerTaskRequest) (*scheduler.RegisterResult, error) {
	metrics.RegisterPeerTaskCount.Inc()

	resp, err := s.service.RegisterPeerTask(ctx, req)
	if err != nil {
		metrics.RegisterPeerTaskFailureCount.Inc()
	} else {
		metrics.PeerTaskCounter.WithLabelValues(resp.SizeScope.String()).Inc()
	}

	return resp, err
}
// RegisterPeerTask registers peer and triggers CDN download task
RegisterPeerTask registers peer and triggers CDN download task
// RegisterPeerTask registers peer and triggers CDN download task
func (s *Server) RegisterPeerTask(ctx context.Context, req *scheduler.PeerTaskRequest) (*scheduler.RegisterResult, error) {
	metrics.RegisterPeerTaskCount.Inc()
	resp, err := s.service.RegisterPeerTask(ctx, req)
	if err != nil {
		metrics.RegisterPeerTaskFailureCount.Inc()
	} else {
		metrics.PeerTaskCounter.WithLabelValues(resp.SizeScope.String()).Inc()
	}
	return resp, err
}
func ( s * Server ) RegisterPeerTask ( ctx context . Context , req * scheduler . PeerTaskRequest ) ( * scheduler . RegisterResult , error ) { metrics . RegisterPeerTaskCount . Inc ( ) resp , err := s . service . RegisterPeerTask ( ctx , req ) if err != nil { metrics . RegisterPeerTaskFailureCount . Inc ( ) } else { metrics . PeerTaskCounter . WithLabelValues ( resp . SizeScope . String ( ) ) . Inc ( ) } return resp , err }
RegisterPeerTask registers peer and triggers CDN download task
RegisterPeerTask registers peer and triggers CDN download task