fix(servers): prevent false "Service Restart Failed" on slow restart
- Raise frontend timeout: restartService 15s→300s, restartNginx 15s→60s - Add SSH-level timeout to restartManagedService (300s) & reloadNginx (60s)
This commit is contained in:
1 parent
8c31f2dc06
commit
f7134a2725
3 files changed
+6
-3
No files matched your search
+2
-2
@@ -1466,13 +1466,13 @@ export const servers = {
|
||||
post<{ success: boolean; message: string }>(
|
||||
`/servers/${id}/nginx/restart`,
|
||||
{},
|
||||
{ timeoutMs: 15000 },
|
||||
{ timeoutMs: 60000 },
|
||||
),
|
||||
restartService: (id: string, service: string) =>
|
||||
post<{ success: boolean; message: string }>(
|
||||
`/servers/${id}/services/${encodeURIComponent(service)}/restart`,
|
||||
{},
|
||||
{ timeoutMs: 15000 },
|
||||
{ timeoutMs: 300000 },
|
||||
),
|
||||
manageWebStack: (
|
||||
id: string,
|
||||
|
||||
@@ -50,7 +50,7 @@ function buildTrackedCommand(command: string, runId: string) {
|
||||
'wait "$child"',
|
||||
"code=$?",
|
||||
"set -e",
|
||||
"exit \"$code\"",
|
||||
'exit "$code"',
|
||||
].join("\n");
|
||||
|
||||
return `bash -lc ${shellQuote(script)}`;
|
||||
|
||||
@@ -406,6 +406,7 @@ export async function restartNginx(server: Server): Promise<void> {
|
||||
server,
|
||||
'bash -lc "systemctl restart nginx || systemctl restart apache2 || systemctl restart httpd"',
|
||||
),
|
||||
{ timeoutMs: 60000 },
|
||||
);
|
||||
}
|
||||
|
||||
@@ -455,6 +456,8 @@ export async function restartManagedService(
|
||||
server,
|
||||
`bash -lc ${escapeShellArg(`systemctl restart ${normalized}`)}`,
|
||||
),
|
||||
// ponytail: 5m matches frontend; lower if service restart is always fast
|
||||
{ timeoutMs: 300000 },
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user