mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-17 01:15:19 +00:00
[autofix.ci] apply automated fixes
This commit is contained in:
@@ -262,35 +262,37 @@ export const cleanupSystem = async (serverId?: string) => {
|
|||||||
*
|
*
|
||||||
* https://github.com/Dokploy/dokploy/pull/3266
|
* https://github.com/Dokploy/dokploy/pull/3266
|
||||||
*/
|
*/
|
||||||
const excludedCleanupAllCommands: (keyof typeof cleanupCommands)[] = ['volumes'];
|
const excludedCleanupAllCommands: (keyof typeof cleanupCommands)[] = [
|
||||||
|
"volumes",
|
||||||
|
];
|
||||||
|
|
||||||
export const cleanupAll = async (serverId?: string) => {
|
export const cleanupAll = async (serverId?: string) => {
|
||||||
for (const [key, command] of Object.entries(cleanupCommands)) {
|
for (const [key, command] of Object.entries(cleanupCommands)) {
|
||||||
if (excludedCleanupAllCommands.includes(key)) continue;
|
if (excludedCleanupAllCommands.includes(key)) continue;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (serverId) {
|
if (serverId) {
|
||||||
await execAsyncRemote(serverId, dockerSafeExec(command));
|
await execAsyncRemote(serverId, dockerSafeExec(command));
|
||||||
} else {
|
} else {
|
||||||
await execAsync(dockerSafeExec(command));
|
await execAsync(dockerSafeExec(command));
|
||||||
}
|
}
|
||||||
} catch {}
|
} catch {}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const cleanupAllBackground = async (serverId?: string) => {
|
export const cleanupAllBackground = async (serverId?: string) => {
|
||||||
Promise.allSettled(
|
Promise.allSettled(
|
||||||
Object.entries(cleanupCommands)
|
Object.entries(cleanupCommands)
|
||||||
.filter(([key]) => !excludedCleanupAllCommands.includes(key))
|
.filter(([key]) => !excludedCleanupAllCommands.includes(key))
|
||||||
.map(async ([, command]) => {
|
.map(async ([, command]) => {
|
||||||
try {
|
try {
|
||||||
if (serverId) {
|
if (serverId) {
|
||||||
await execAsyncRemote(serverId, dockerSafeExec(command));
|
await execAsyncRemote(serverId, dockerSafeExec(command));
|
||||||
} else {
|
} else {
|
||||||
await execAsync(dockerSafeExec(command));
|
await execAsync(dockerSafeExec(command));
|
||||||
}
|
}
|
||||||
} catch {}
|
} catch {}
|
||||||
})
|
}),
|
||||||
)
|
)
|
||||||
.then((results) => {
|
.then((results) => {
|
||||||
const failed = results.filter((r) => r.status === "rejected");
|
const failed = results.filter((r) => r.status === "rejected");
|
||||||
|
|||||||
Reference in New Issue
Block a user