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

Function scheduleJob

packages/server/src/utils/schedules/utils.ts:16–32  ·  view source on GitHub ↗
(schedule: Schedule)

Source from the content-addressed store, hash-verified

14import { spawnAsync } from "../process/spawnAsync";
15
16export const scheduleJob = (schedule: Schedule) => {
17 const { cronExpression, scheduleId, timezone } = schedule;
18
19 // Use timezone from schedule, default to UTC if not specified
20 const tz = timezone || "UTC";
21
22 scheduleJobNode(
23 scheduleId,
24 {
25 tz,
26 rule: cronExpression,
27 },
28 async () => {
29 await runCommand(scheduleId);
30 },
31 );
32};
33
34export const removeScheduleJob = (scheduleId: string) => {
35 const currentJob = scheduledJobs[scheduleId];

Callers 7

initSchedulesFunction · 0.90
schedule.tsFile · 0.90
scheduleVolumeBackupFunction · 0.50
startLogCleanupFunction · 0.50
initCronJobsFunction · 0.50
scheduleBackupFunction · 0.50

Calls 1

runCommandFunction · 0.85

Tested by

no test coverage detected