mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-08 21:15:17 +00: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);
|
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,
|
env: preparedEnv,
|
||||||
additionalPorts: newPorts,
|
additionalPorts: newPorts,
|
||||||
serverId: input.serverId,
|
serverId: input.serverId,
|
||||||
|
}).catch((err) => {
|
||||||
|
console.error("toggleDashboard background writeTraefikSetup:", err);
|
||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in New Issue
Block a user