Skip to content

Commit

Permalink
chore: repo overall update
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangtao25 committed Nov 20, 2024
1 parent 99e2392 commit 734c0d8
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,23 @@ import { coverageObj } from '../models/coverage.model';
export class CoverageMapClientService {
constructor(private readonly prisma: PrismaService) {}
async invoke({ sha, projectID, coverage, instrumentCwd, branch }) {
// 先检查有没有
const exist = await this.prisma.coverage.findFirst({
where: {
sha: sha,
projectID: projectID,
covType: 'all',
},
});

if (exist) {
return {
id: exist.id,
projectID: exist.projectID,
sha: exist.sha,
};
}

const coverageObject =
typeof coverage === 'string' ? JSON.parse(coverage) : coverage;

Expand Down

0 comments on commit 734c0d8

Please sign in to comment.