mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-07-19 21:05:21 +02:00
fix: typing
This commit is contained in:
@@ -284,33 +284,34 @@ 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)
|
(Object.entries(cleanupCommands) as [
|
||||||
.filter(([key]) => !excludedCleanupAllCommands.includes(key))
|
keyof typeof cleanupCommands,
|
||||||
.map(async ([, command]) => {
|
string
|
||||||
try {
|
][])
|
||||||
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 {
|
||||||
} catch {}
|
await execAsync(dockerSafeExec(command));
|
||||||
}),
|
}
|
||||||
)
|
})
|
||||||
.then((results) => {
|
)
|
||||||
const failed = results.filter((r) => r.status === "rejected");
|
.then((results) => {
|
||||||
if (failed.length > 0) {
|
const failed = results.filter((r) => r.status === "rejected");
|
||||||
console.error(`Docker cleanup: ${failed.length} operations failed`);
|
if (failed.length > 0) {
|
||||||
} else {
|
console.error(`Docker cleanup: ${failed.length} operations failed`);
|
||||||
console.log("Docker cleanup completed successfully");
|
} 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) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user