mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-06-15 20:25:23 +02:00
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.
This commit is contained in:
@@ -158,10 +158,14 @@ export const settingsRouter = createTRPCRouter({
|
||||
newPorts = ports.filter((port) => port.targetPort !== 8080);
|
||||
}
|
||||
|
||||
await writeTraefikSetup({
|
||||
// Run in background so the request returns immediately; client polls /api/health.
|
||||
// Avoids proxy timeouts (520) while Traefik is recreated.
|
||||
void writeTraefikSetup({
|
||||
env: preparedEnv,
|
||||
additionalPorts: newPorts,
|
||||
serverId: input.serverId,
|
||||
}).catch((err) => {
|
||||
console.error("toggleDashboard background writeTraefikSetup:", err);
|
||||
});
|
||||
return true;
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user