Merge pull request #4955 from Dokploy/fix/schedule-run-manually-deployment-metadata

fix(schedule): return deployment metadata from runManually and fail early on missing container

(cherry picked from commit 11e93dde38)
This commit is contained in:
Mauricio Siu
2026-08-05 23:48:03 -06:00
committed by Mauricio Siu
parent 0f0102ff2d
commit 83008205b9
3 changed files with 90 additions and 68 deletions
@@ -58,8 +58,12 @@ export const ShowSchedules = ({ id, scheduleType = "application" }: Props) => {
const handleRunManually = async (scheduleId: string) => {
setRunningSchedules((prev) => new Set(prev).add(scheduleId));
try {
await runManually({ scheduleId });
toast.success("Schedule run successfully");
const result = await runManually({ scheduleId });
if (result.status === "error") {
toast.error("Schedule run failed, check the deployment logs");
} else {
toast.success("Schedule run successfully");
}
await refetchSchedules();
} catch {
toast.error("Error running schedule");
+6 -2
View File
@@ -315,13 +315,17 @@ export const scheduleRouter = createTRPCRouter({
await checkPermission(ctx, { schedule: ["create"] });
}
try {
await runCommand(input.scheduleId);
const deployment = await runCommand(input.scheduleId);
await audit(ctx, {
action: "run",
resourceType: "schedule",
resourceId: input.scheduleId,
});
return true;
return {
status: deployment.status,
deploymentId: deployment.deploymentId,
logPath: deployment.logPath,
};
} catch (error) {
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",