[autofix.ci] apply automated fixes

This commit is contained in:
autofix-ci[bot]
2025-12-14 05:20:20 +00:00
committed by GitHub
parent b66156956a
commit 2b1a3db7b8
+29 -27
View File
@@ -284,34 +284,36 @@ export const cleanupAll = async (serverId?: string) => {
}; };
export const cleanupAllBackground = async (serverId?: string) => { export const cleanupAllBackground = async (serverId?: string) => {
Promise.allSettled( Promise.allSettled(
(Object.entries(cleanupCommands) as [ (
keyof typeof cleanupCommands, Object.entries(cleanupCommands) as [
string keyof typeof cleanupCommands,
][]) string,
.filter(([key]) => !excludedCleanupAllCommands.includes(key)) ][]
.map(async ([, command]) => { )
if (serverId) { .filter(([key]) => !excludedCleanupAllCommands.includes(key))
await execAsyncRemote(serverId, dockerSafeExec(command)); .map(async ([, command]) => {
} else { if (serverId) {
await execAsync(dockerSafeExec(command)); await execAsyncRemote(serverId, dockerSafeExec(command));
} } else {
}) await execAsync(dockerSafeExec(command));
) }
.then((results) => { }),
const failed = results.filter((r) => r.status === "rejected"); )
if (failed.length > 0) { .then((results) => {
console.error(`Docker cleanup: ${failed.length} operations failed`); const failed = results.filter((r) => r.status === "rejected");
} else { if (failed.length > 0) {
console.log("Docker cleanup completed successfully"); console.error(`Docker cleanup: ${failed.length} operations failed`);
} } else {
}) console.log("Docker cleanup completed successfully");
.catch((error) => console.error("Error in cleanup:", error)); }
})
.catch((error) => console.error("Error in cleanup:", error));
return { return {
status: "scheduled", status: "scheduled",
message: "Docker cleanup has been initiated in the background", message: "Docker cleanup has been initiated in the background",
}; };
}; };
export const startService = async (appName: string) => { export const startService = async (appName: string) => {