mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-07-16 19:35:25 +02:00
feat(deployment): improve stuck deployment detection and update status
- Enhanced the stuck deployment check to only consider the most recent deployment. - Updated the logic to correctly identify if the most recent deployment has been running for more than 9 minutes. - Added functionality to update the deployment status to "done" upon application and compose cancellation.
This commit is contained in:
@@ -24,6 +24,7 @@ import {
|
||||
unzipDrop,
|
||||
updateApplication,
|
||||
updateApplicationStatus,
|
||||
updateDeploymentStatus,
|
||||
writeConfig,
|
||||
writeConfigRemote,
|
||||
// uploadFileSchema
|
||||
@@ -919,6 +920,14 @@ export const applicationRouter = createTRPCRouter({
|
||||
if (IS_CLOUD && application.serverId) {
|
||||
try {
|
||||
await updateApplicationStatus(input.applicationId, "idle");
|
||||
|
||||
if (application.deployments[0]) {
|
||||
await updateDeploymentStatus(
|
||||
application.deployments[0].deploymentId,
|
||||
"done",
|
||||
);
|
||||
}
|
||||
|
||||
await cancelDeployment({
|
||||
applicationId: input.applicationId,
|
||||
applicationType: "application",
|
||||
|
||||
@@ -29,6 +29,7 @@ import {
|
||||
startCompose,
|
||||
stopCompose,
|
||||
updateCompose,
|
||||
updateDeploymentStatus,
|
||||
} from "@dokploy/server";
|
||||
import {
|
||||
type CompleteTemplate,
|
||||
@@ -953,6 +954,14 @@ export const composeRouter = createTRPCRouter({
|
||||
await updateCompose(input.composeId, {
|
||||
composeStatus: "idle",
|
||||
});
|
||||
|
||||
if (compose.deployments[0]) {
|
||||
await updateDeploymentStatus(
|
||||
compose.deployments[0].deploymentId,
|
||||
"done",
|
||||
);
|
||||
}
|
||||
|
||||
await cancelDeployment({
|
||||
composeId: input.composeId,
|
||||
applicationType: "compose",
|
||||
|
||||
Reference in New Issue
Block a user