chore: renamed dockerSafeExec

This commit is contained in:
фырат ёздэн
2025-11-30 21:27:07 +03:00
committed by GitHub
parent b6de55c4d9
commit e1d8505757

View File

@@ -146,7 +146,7 @@ export const getContainerByName = (name: string): Promise<ContainerInfo> => {
};
// Commands passed through this method are held during Docker's build or pull process. (https://github.com/dokploy/dokploy/pull/3064)
export const createDockerSafeExec = (command: string) => `CHECK_INTERVAL=10
export const dockerSafeExec = (command: string) => `CHECK_INTERVAL=10
echo "Starting Docker cleanup..."
@@ -170,9 +170,9 @@ export const cleanUpUnusedImages = async (serverId?: string) => {
try {
const command = "docker image prune --all --force";
if (serverId) {
await execAsyncRemote(serverId, createDockerSafeExec(command));
await execAsyncRemote(serverId, dockerSafeExec(command));
} else {
await execAsync(createDockerSafeExec(command));
await execAsync(dockerSafeExec(command));
}
} catch (error) {
console.error(error);
@@ -184,9 +184,9 @@ export const cleanStoppedContainers = async (serverId?: string) => {
try {
const command = "docker container prune --force";
if (serverId) {
await execAsyncRemote(serverId, createDockerSafeExec(command));
await execAsyncRemote(serverId, dockerSafeExec(command));
} else {
await execAsync(createDockerSafeExec(command));
await execAsync(dockerSafeExec(command));
}
} catch (error) {
console.error(error);
@@ -198,9 +198,9 @@ export const cleanUpUnusedVolumes = async (serverId?: string) => {
try {
const command = "docker volume prune --all --force";
if (serverId) {
await execAsyncRemote(serverId, createDockerSafeExec(command));
await execAsyncRemote(serverId, dockerSafeExec(command));
} else {
await execAsync(createDockerSafeExec(command));
await execAsync(dockerSafeExec(command));
}
} catch (error) {
console.error(error);
@@ -228,18 +228,18 @@ export const cleanUpInactiveContainers = async () => {
export const cleanUpDockerBuilder = async (serverId?: string) => {
const command = "docker builder prune --all --force";
if (serverId) {
await execAsyncRemote(serverId, createDockerSafeExec(command));
await execAsyncRemote(serverId, dockerSafeExec(command));
} else {
await execAsync(createDockerSafeExec(command));
await execAsync(dockerSafeExec(command));
}
};
export const cleanUpSystemPrune = async (serverId?: string) => {
const command = "docker system prune --all --volumes --force";
if (serverId) {
await execAsyncRemote(serverId, createDockerSafeExec(command));
await execAsyncRemote(serverId, dockerSafeExec(command));
} else {
await execAsync(createDockerSafeExec(command));
await execAsync(dockerSafeExec(command));
}
};