mirror of
https://github.com/LukeHagar/dokploy.git
synced 2025-12-06 04:19:37 +00:00
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.
This commit is contained in:
@@ -43,6 +43,7 @@ void app.prepare().then(async () => {
|
|||||||
if (!IS_CLOUD) {
|
if (!IS_CLOUD) {
|
||||||
setupDockerStatsMonitoringSocketServer(server);
|
setupDockerStatsMonitoringSocketServer(server);
|
||||||
}
|
}
|
||||||
|
await initCancelDeployments();
|
||||||
|
|
||||||
if (process.env.NODE_ENV === "production" && !IS_CLOUD) {
|
if (process.env.NODE_ENV === "production" && !IS_CLOUD) {
|
||||||
setupDirectories();
|
setupDirectories();
|
||||||
@@ -53,7 +54,6 @@ void app.prepare().then(async () => {
|
|||||||
await migration();
|
await migration();
|
||||||
await initCronJobs();
|
await initCronJobs();
|
||||||
await initSchedules();
|
await initSchedules();
|
||||||
await initCancelDeployments();
|
|
||||||
await initVolumeBackupsCronJobs();
|
await initVolumeBackupsCronJobs();
|
||||||
await sendDokployRestartNotifications();
|
await sendDokployRestartNotifications();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ export const initCancelDeployments = async () => {
|
|||||||
console.log("Setting up cancel deployments....");
|
console.log("Setting up cancel deployments....");
|
||||||
|
|
||||||
const result = await db.update(deployments).set({
|
const result = await db.update(deployments).set({
|
||||||
status: "error",
|
status: "cancelled",
|
||||||
}).where(eq(deployments.status, "cancelled"));
|
}).where(eq(deployments.status, "running")).returning();
|
||||||
|
|
||||||
console.log(`Cancelled ${result.length} deployments`);
|
console.log(`Cancelled ${result.length} deployments`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user