From d66f22a5575fe5d71e03c5c881f653ff254518e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Allen=20Zhang=20=28=E5=BC=A0=E6=B6=9B=29?= Date: Fri, 23 Feb 2024 10:18:20 +0800 Subject: [PATCH] feat: GetProjectRecordDetailByShaService limit --- .../services/get-project-record-detail-by-sha.service.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/canyon-backend/src/project/services/get-project-record-detail-by-sha.service.ts b/packages/canyon-backend/src/project/services/get-project-record-detail-by-sha.service.ts index 0e2fc202..d952c266 100644 --- a/packages/canyon-backend/src/project/services/get-project-record-detail-by-sha.service.ts +++ b/packages/canyon-backend/src/project/services/get-project-record-detail-by-sha.service.ts @@ -1,20 +1,20 @@ import { Injectable } from '@nestjs/common'; import { PrismaService } from '../../prisma/prisma.service'; -import { calculateCoverageOverviewByConditionFilter } from '../../utils/summary'; -// import process from 'process'; -import { getCommits } from '../../adapter/gitlab.adapter'; import { percent } from '../../utils/utils'; -// import { getProjectByID } from '../adapter/gitlab.adapter'; @Injectable() export class GetProjectRecordDetailByShaService { constructor(private readonly prisma: PrismaService) {} async invoke(projectID, sha): Promise { + const current = 1; + const pageSize = 200; const coverages = await this.prisma.coverage.findMany({ where: { projectID, sha, covType: 'agg', }, + skip: (current - 1) * pageSize, + take: pageSize, orderBy: { createdAt: 'desc', },