Working on the retention system.

This commit is contained in:
charlesgauthereau
2025-08-24 20:11:34 +02:00
parent 7ac99a6618
commit 60728885b6
9 changed files with 48 additions and 4 deletions
+10
View File
@@ -2,6 +2,8 @@ import {env} from "@/env.mjs";
import {db, makeMigration} from "@/db";
import {eq} from "drizzle-orm";
import * as drizzleDb from "@/db";
import cron from "node-cron";
import {retentionJob} from "@/lib/tasks";
export async function init() {
@@ -11,8 +13,16 @@ export async function init() {
await createDefaultOrganization();
await createSettingsIfNotExist()
console.log("====Initialization completed====");
await setupCronJobs()
}
async function setupCronJobs() {
console.log("==== Setting up Cron Jobs ====");
retentionJob.start();
console.log(`==== Cron job started ====`);
}
async function createSettingsIfNotExist() {
const configSettings = {
name: "system",