Skip to content

Commit 2b1a3db

Browse files
[autofix.ci] apply automated fixes
1 parent b661569 commit 2b1a3db

File tree

1 file changed

+30
-28
lines changed
  • packages/server/src/utils/docker

1 file changed

+30
-28
lines changed

packages/server/src/utils/docker/utils.ts

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -284,34 +284,36 @@ export const cleanupAll = async (serverId?: string) => {
284284
};
285285

286286
export const cleanupAllBackground = async (serverId?: string) => {
287-
Promise.allSettled(
288-
(Object.entries(cleanupCommands) as [
289-
keyof typeof cleanupCommands,
290-
string
291-
][])
292-
.filter(([key]) => !excludedCleanupAllCommands.includes(key))
293-
.map(async ([, command]) => {
294-
if (serverId) {
295-
await execAsyncRemote(serverId, dockerSafeExec(command));
296-
} else {
297-
await execAsync(dockerSafeExec(command));
298-
}
299-
})
300-
)
301-
.then((results) => {
302-
const failed = results.filter((r) => r.status === "rejected");
303-
if (failed.length > 0) {
304-
console.error(`Docker cleanup: ${failed.length} operations failed`);
305-
} else {
306-
console.log("Docker cleanup completed successfully");
307-
}
308-
})
309-
.catch((error) => console.error("Error in cleanup:", error));
310-
311-
return {
312-
status: "scheduled",
313-
message: "Docker cleanup has been initiated in the background",
314-
};
287+
Promise.allSettled(
288+
(
289+
Object.entries(cleanupCommands) as [
290+
keyof typeof cleanupCommands,
291+
string,
292+
][]
293+
)
294+
.filter(([key]) => !excludedCleanupAllCommands.includes(key))
295+
.map(async ([, command]) => {
296+
if (serverId) {
297+
await execAsyncRemote(serverId, dockerSafeExec(command));
298+
} else {
299+
await execAsync(dockerSafeExec(command));
300+
}
301+
}),
302+
)
303+
.then((results) => {
304+
const failed = results.filter((r) => r.status === "rejected");
305+
if (failed.length > 0) {
306+
console.error(`Docker cleanup: ${failed.length} operations failed`);
307+
} else {
308+
console.log("Docker cleanup completed successfully");
309+
}
310+
})
311+
.catch((error) => console.error("Error in cleanup:", error));
312+
313+
return {
314+
status: "scheduled",
315+
message: "Docker cleanup has been initiated in the background",
316+
};
315317
};
316318

317319
export const startService = async (appName: string) => {

0 commit comments

Comments
 (0)