feat: Add stop_grace_period to swarm settings

This commit is contained in:
Lucas Manchine
2025-07-23 20:38:27 +00:00
committed by GitHub
parent b95dfed8fc
commit b4a5221caf
6 changed files with 6182 additions and 0 deletions

View File

@@ -202,6 +202,7 @@ export const applications = pgTable("application", {
modeSwarm: json("modeSwarm").$type<ServiceModeSwarm>(),
labelsSwarm: json("labelsSwarm").$type<LabelsSwarm>(),
networkSwarm: json("networkSwarm").$type<NetworkSwarm[]>(),
stopGracePeriodSwarm: text("stopGracePeriodSwarm"),
//
replicas: integer("replicas").default(1).notNull(),
applicationStatus: applicationStatus("applicationStatus")
@@ -435,6 +436,7 @@ const createSchema = createInsertSchema(applications, {
previewRequireCollaboratorPermissions: z.boolean().optional(),
watchPaths: z.array(z.string()).optional(),
cleanCache: z.boolean().optional(),
stopGracePeriodSwarm: z.string().nullable(),
});
export const apiCreateApplication = createSchema.pick({

View File

@@ -360,6 +360,7 @@ export const generateConfigContainer = (application: ApplicationNested) => {
replicas,
mounts,
networkSwarm,
stopGracePeriodSwarm,
} = application;
const haveMounts = mounts.length > 0;
@@ -410,6 +411,9 @@ export const generateConfigContainer = (application: ApplicationNested) => {
Order: "start-first",
},
}),
...(stopGracePeriodSwarm && {
StopGracePeriod: parseInt(stopGracePeriodSwarm, 10),
}),
...(networkSwarm
? {
Networks: networkSwarm,