mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-06-26 17:45:49 +02:00
- 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.
18 lines
514 B
TypeScript
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);
|
|
}
|
|
};
|