mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-06-19 14:15:21 +02:00
chore: renamed dockerSafeExec
This commit is contained in:
@@ -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));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user