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

Function scheduleJob

apps/schedules/src/queue.ts:24–51  ·  view source on GitHub ↗
(job: QueueJob)

Source from the content-addressed store, hash-verified

22};
23
24export const scheduleJob = async (job: QueueJob) => {
25 if (job.type === "backup") {
26 await jobQueue.add(job.backupId, job, {
27 repeat: {
28 pattern: job.cronSchedule,
29 },
30 });
31 } else if (job.type === "server") {
32 await jobQueue.add(`${job.serverId}-cleanup`, job, {
33 repeat: {
34 pattern: job.cronSchedule,
35 },
36 });
37 } else if (job.type === "schedule") {
38 await jobQueue.add(job.scheduleId, job, {
39 repeat: {
40 pattern: job.cronSchedule,
41 tz: job.timezone || "UTC",
42 },
43 });
44 } else if (job.type === "volume-backup") {
45 await jobQueue.add(job.volumeBackupId, job, {
46 repeat: {
47 pattern: job.cronSchedule,
48 },
49 });
50 }
51};
52
53export const removeJob = async (data: QueueJob) => {
54 if (data.type === "backup") {

Callers 4

index.tsFile · 0.70
initializeJobsFunction · 0.70
settings.tsFile · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected