Files
dokploy/packages/server/src/utils/startup/cancell-deployments.ts
Mauricio Siu 6fa8f63277 fix(deployment): correct deployment cancellation logic and ensure proper status update
- Updated the initCancelDeployments function to set the status of running deployments to 'cancelled' instead of 'error'.
- Reintroduced the call to initCancelDeployments in the server initialization process to ensure cancellations are handled correctly.
2025-09-27 02:20:07 -06:00

18 lines
514 B
TypeScript

import { deployments } from "@dokploy/server/db/schema";
import { eq } from "drizzle-orm";
import { db } from "../../db/index";
export const initCancelDeployments = async () => {
try {
console.log("Setting up cancel deployments....");
const result = await db.update(deployments).set({
status: "cancelled",
}).where(eq(deployments.status, "running")).returning();
console.log(`Cancelled ${result.length} deployments`);
} catch (error) {
console.error(error);
}
};