mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-07-27 16:55:25 +02:00
- Added functionality for assigning Docker networks to services, allowing users to manage network associations directly from the UI. - Introduced new components for assigning networks to both individual services and compose files, improving user experience and flexibility. - Updated existing components to integrate network assignment features, ensuring seamless interaction within the dashboard. - Enhanced the database schema to support new network-related fields, including `networkIds` and `detachDokployNetwork`, for better service configuration. - Improved the layout and responsiveness of various UI elements to accommodate new features and enhance usability.
32 lines
998 B
TypeScript
32 lines
998 B
TypeScript
export * from "./backup";
|
|
export * from "./restore";
|
|
export * from "./utils";
|
|
|
|
import { volumeBackups } from "@dokploy/server/db/schema";
|
|
import { eq } from "drizzle-orm";
|
|
import { db } from "../../db/index";
|
|
import { scheduleVolumeBackup } from "./utils";
|
|
|
|
export const initVolumeBackupsCronJobs = async () => {
|
|
console.log("Setting up volume backups cron jobs....");
|
|
try {
|
|
const volumeBackupsResult = await db.query.volumeBackups.findMany({
|
|
where: eq(volumeBackups.enabled, true),
|
|
with: {
|
|
application: { columns: { applicationId: true } },
|
|
compose: { columns: { composeId: true } },
|
|
},
|
|
});
|
|
|
|
console.log(`Initializing ${volumeBackupsResult.length} volume backups`);
|
|
for (const volumeBackup of volumeBackupsResult) {
|
|
scheduleVolumeBackup(volumeBackup.volumeBackupId);
|
|
console.log(
|
|
`Initialized volume backup: ${volumeBackup.name} ${volumeBackup.serviceType} ✅`,
|
|
);
|
|
}
|
|
} catch (error) {
|
|
console.log(`Error initializing volume backups: ${error}`);
|
|
}
|
|
};
|