This commit is contained in:
xiaojunnuo
2024-10-10 02:15:05 +08:00
parent b5d8935159
commit f0b2a61246
26 changed files with 262 additions and 120 deletions
@@ -68,6 +68,9 @@ export class HistoryService extends BaseService<HistoryEntity> {
}
private async clear(pipelineId: number, keepCount = 20) {
if (pipelineId == null) {
return;
}
const count = await this.repository.count({
where: {
pipelineId,
@@ -139,6 +142,9 @@ export class HistoryService extends BaseService<HistoryEntity> {
}
async deleteByIds(ids: number[], userId: number) {
if (!ids || ids.length === 0) {
return;
}
const condition: any = {
id: In(ids),
};
@@ -150,6 +156,9 @@ export class HistoryService extends BaseService<HistoryEntity> {
}
async deleteByPipelineId(id: number) {
if (id == null) {
return;
}
await this.repository.delete({
pipelineId: id,
});