mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-07-28 01:05: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.
33 lines
887 B
TypeScript
33 lines
887 B
TypeScript
import { schedules } from "@dokploy/server/db/schema";
|
|
import { eq } from "drizzle-orm";
|
|
import { db } from "../../db/index";
|
|
import { scheduleJob } from "./utils";
|
|
|
|
export const initSchedules = async () => {
|
|
try {
|
|
const schedulesResult = await db.query.schedules.findMany({
|
|
where: eq(schedules.enabled, true),
|
|
with: {
|
|
server: true,
|
|
application: {
|
|
columns: { applicationId: true, appName: true, serverId: true },
|
|
},
|
|
compose: {
|
|
columns: { composeId: true, appName: true, serverId: true },
|
|
},
|
|
organization: true,
|
|
},
|
|
});
|
|
|
|
console.log(`Initializing ${schedulesResult.length} schedules`);
|
|
for (const schedule of schedulesResult) {
|
|
scheduleJob(schedule);
|
|
console.log(
|
|
`Initialized schedule: ${schedule.name} ${schedule.scheduleType} ✅`,
|
|
);
|
|
}
|
|
} catch (error) {
|
|
console.log(`Error initializing schedules: ${error}`);
|
|
}
|
|
};
|