feat: 限制发布单重试边界

This commit is contained in:
湛兮
2026-06-12 01:16:41 +08:00
parent bc3aa31289
commit 78f97fedf8
2 changed files with 29 additions and 1 deletions
+13
View File
@@ -111,6 +111,7 @@ export class DeployRunsService {
projectKey: input.projectKey,
environment: input.environment,
ref: input.ref,
trigger: input.trigger ?? 'manual',
remark: input.remark,
},
});
@@ -182,6 +183,18 @@ export class DeployRunsService {
): Promise<DeployRunSummary> {
const source = await this.getRun(id, user);
if (!['failed', 'canceled'].includes(source.status)) {
throw new AppError(
'VALIDATION_FAILED',
`发布记录 ${id} 当前状态为 ${source.status},只能重试失败或已取消的发布单`,
400,
{
id,
status: source.status,
},
);
}
return this.createRun(
{
projectKey: source.projectKey,