Track cancelled deployments separately.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
keyhan
2026-05-18 22:15:43 +03:30
parent d5e6ab0f68
commit 68d1ccb196
10 changed files with 34 additions and 9 deletions
@@ -117,7 +117,7 @@ export class DeploymentsService {
if (error instanceof BuildCancelledError || error?.name === 'BuildCancelledError') {
this.logger.log(`Deployment ${deploymentId} cancelled by user`);
await this.deploymentsRepository.update(deploymentId, {
status: DeploymentStatus.FAILED,
status: DeploymentStatus.CANCELLED,
errorMessage: 'Cancelled by user',
finishedAt: new Date(),
});
@@ -209,6 +209,9 @@ export class DeploymentsService {
if (latest.status === DeploymentStatus.FAILED) {
return { phase: 'failed', percent: 0, message: latest.errorMessage || 'Deployment failed' };
}
if (latest.status === DeploymentStatus.CANCELLED) {
return { phase: 'cancelled', percent: 0, message: latest.errorMessage || 'Cancelled by user' };
}
if (latest.status === DeploymentStatus.BUILDING) {
return { phase: 'building', percent: 0, message: 'Building...' };
}
@@ -242,7 +245,7 @@ export class DeploymentsService {
await this.buildService.cancelBuild(latest.id);
await this.buildService.cleanupBuildResourcesForApp(app);
latest.status = DeploymentStatus.FAILED;
latest.status = DeploymentStatus.CANCELLED;
latest.errorMessage = 'Cancelled by user';
latest.finishedAt = new Date();
return this.deploymentsRepository.save(latest);