MCPcopy
hub / github.com/Dokploy/dokploy / applyDockerCleanupSchedule

Function applyDockerCleanupSchedule

apps/dokploy/server/utils/docker-cleanup.ts:10–39  ·  view source on GitHub ↗
(
	serverId: string,
	organizationId: string,
	enable: boolean,
)

Source from the content-addressed store, hash-verified

8import { removeJob, schedule } from "./backup";
9
10export const applyDockerCleanupSchedule = async (
11 serverId: string,
12 organizationId: string,
13 enable: boolean,
14) => {
15 if (enable) {
16 if (IS_CLOUD) {
17 await schedule({
18 cronSchedule: CLEANUP_CRON_JOB,
19 serverId,
20 type: "server",
21 });
22 } else {
23 scheduleJob(serverId, CLEANUP_CRON_JOB, async () => {
24 await cleanupAll(serverId);
25 await sendDockerCleanupNotifications(organizationId);
26 });
27 }
28 } else {
29 if (IS_CLOUD) {
30 await removeJob({
31 cronSchedule: CLEANUP_CRON_JOB,
32 serverId,
33 type: "server",
34 });
35 } else {
36 scheduledJobs[serverId]?.cancel();
37 }
38 }
39};

Callers 1

server.tsFile · 0.90

Calls 5

scheduleFunction · 0.90
cleanupAllFunction · 0.90
removeJobFunction · 0.90
scheduleJobFunction · 0.50

Tested by

no test coverage detected