Merge pull request #1609 from Dokploy/canary

🚀 Release v0.21.2
This commit is contained in:
Mauricio Siu 2025-04-02 07:22:22 -06:00 committed by GitHub
commit 116e33ce37
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 15 additions and 5 deletions

View File

@ -1,6 +1,6 @@
{
"name": "dokploy",
"version": "v0.21.1",
"version": "v0.21.2",
"private": true,
"license": "Apache-2.0",
"type": "module",

View File

@ -46,8 +46,8 @@ void app.prepare().then(async () => {
await initializeNetwork();
createDefaultTraefikConfig();
createDefaultServerTraefikConfig();
await initCronJobs();
await migration();
await initCronJobs();
await sendDokployRestartNotifications();
}

View File

@ -2,7 +2,6 @@ import path from "node:path";
import { getAllServers } from "@dokploy/server/services/server";
import { scheduleJob } from "node-schedule";
import { db } from "../../db/index";
import { findAdmin } from "../../services/admin";
import {
cleanUpDockerBuilder,
cleanUpSystemPrune,
@ -14,13 +13,24 @@ import { getS3Credentials, scheduleBackup } from "./utils";
import type { BackupSchedule } from "@dokploy/server/services/backup";
import { startLogCleanup } from "../access-log/handler";
import { member } from "@dokploy/server/db/schema";
import { eq } from "drizzle-orm";
export const initCronJobs = async () => {
console.log("Setting up cron jobs....");
const admin = await findAdmin();
const admin = await db.query.member.findFirst({
where: eq(member.role, "owner"),
with: {
user: true,
},
});
if (admin?.user.enableDockerCleanup) {
if (!admin) {
return;
}
if (admin.user.enableDockerCleanup) {
scheduleJob("docker-cleanup", "0 0 * * *", async () => {
console.log(
`Docker Cleanup ${new Date().toLocaleString()}] Running docker cleanup`,