mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-06-15 20:25:23 +02:00
feat(settings): improve background execution of Traefik setup with error logging
- Updated Traefik setup calls to run in the background, allowing immediate client response. - Added error handling to log issues during the background execution of Traefik setup for better debugging.
This commit is contained in:
@@ -605,12 +605,14 @@ export const settingsRouter = createTRPCRouter({
|
||||
const envs = prepareEnvironmentVariables(input.env);
|
||||
const ports = await readPorts("dokploy-traefik", input?.serverId);
|
||||
|
||||
await writeTraefikSetup({
|
||||
// Run in background so the request returns immediately; client polls /api/health.
|
||||
void writeTraefikSetup({
|
||||
env: envs,
|
||||
additionalPorts: ports,
|
||||
serverId: input.serverId,
|
||||
}).catch((err) => {
|
||||
console.error("writeTraefikEnv background writeTraefikSetup:", err);
|
||||
});
|
||||
|
||||
return true;
|
||||
}),
|
||||
haveTraefikDashboardPortEnabled: adminProcedure
|
||||
@@ -858,10 +860,16 @@ export const settingsRouter = createTRPCRouter({
|
||||
}
|
||||
const preparedEnv = prepareEnvironmentVariables(env);
|
||||
|
||||
await writeTraefikSetup({
|
||||
// Run in background so the request returns immediately; client polls /api/health.
|
||||
void writeTraefikSetup({
|
||||
env: preparedEnv,
|
||||
additionalPorts: input.additionalPorts,
|
||||
serverId: input.serverId,
|
||||
}).catch((err) => {
|
||||
console.error(
|
||||
"updateTraefikPorts background writeTraefikSetup:",
|
||||
err,
|
||||
);
|
||||
});
|
||||
return true;
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user