mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-07-13 01:45:23 +02:00
feat: extend volume backup functionality with scheduling and management
- Added support for volume backup jobs in the scheduling and removal processes. - Enhanced job management to include volume backups in the job queue. - Updated schema to accommodate volume backup data structure. - Implemented initialization of volume backup jobs based on server status, improving backup management.
This commit is contained in:
@@ -42,6 +42,12 @@ export const scheduleJob = (job: QueueJob) => {
|
||||
pattern: job.cronSchedule,
|
||||
},
|
||||
});
|
||||
} else if (job.type === "volume-backup") {
|
||||
jobQueue.add(job.volumeBackupId, job, {
|
||||
repeat: {
|
||||
pattern: job.cronSchedule,
|
||||
},
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -67,6 +73,13 @@ export const removeJob = async (data: QueueJob) => {
|
||||
});
|
||||
return result;
|
||||
}
|
||||
if (data.type === "volume-backup") {
|
||||
const { volumeBackupId, cronSchedule } = data;
|
||||
const result = await jobQueue.removeRepeatable(volumeBackupId, {
|
||||
pattern: cronSchedule,
|
||||
});
|
||||
return result;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
@@ -89,6 +102,10 @@ export const getJobRepeatable = async (
|
||||
const job = repeatableJobs.find((j) => j.name === scheduleId);
|
||||
return job ? job : null;
|
||||
}
|
||||
|
||||
if (data.type === "volume-backup") {
|
||||
const { volumeBackupId } = data;
|
||||
const job = repeatableJobs.find((j) => j.name === volumeBackupId);
|
||||
return job ? job : null;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user