Skip to content

Commit aa2e0e8

Browse files
committed
feat(settings): run Traefik setup in background to prevent proxy timeouts
- Modified the Traefik setup call to execute in the background, allowing immediate response to the client. - Added error handling to log any issues during the background execution of the Traefik setup.
1 parent 3750cda commit aa2e0e8

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

apps/dokploy/server/api/routers/settings.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,14 @@ export const settingsRouter = createTRPCRouter({
158158
newPorts = ports.filter((port) => port.targetPort !== 8080);
159159
}
160160

161-
await writeTraefikSetup({
161+
// Run in background so the request returns immediately; client polls /api/health.
162+
// Avoids proxy timeouts (520) while Traefik is recreated.
163+
void writeTraefikSetup({
162164
env: preparedEnv,
163165
additionalPorts: newPorts,
164166
serverId: input.serverId,
167+
}).catch((err) => {
168+
console.error("toggleDashboard background writeTraefikSetup:", err);
165169
});
166170
return true;
167171
}),

0 commit comments

Comments
 (0)