From ea8abe7cfcee925dfb2d1254c021af8c69d87e20 Mon Sep 17 00:00:00 2001 From: bigint Date: Tue, 3 Sep 2024 18:37:48 +0530 Subject: [PATCH] feat(truncate): schedule daily truncation job for Everland bucket in cron service to automate object management --- apps/cron/src/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/cron/src/index.ts b/apps/cron/src/index.ts index 52ed2abffdb6..763bf20ceb28 100644 --- a/apps/cron/src/index.ts +++ b/apps/cron/src/index.ts @@ -10,6 +10,7 @@ import cleanEmailTokens from './cleanEmailTokens'; import cleanPreferences from './cleanPreferences'; import dbVacuum from './dbVacuum'; import heartbeat from './heartbeat'; +import truncate4EverlandBucket from './truncate4EverlandBucket'; const startCronJobs = () => { logger.info('Cron jobs are started...'); @@ -24,6 +25,11 @@ const startCronJobs = () => { return; }); + cron.schedule('0 0 * * *', async () => { + await truncate4EverlandBucket(); + return; + }); + cron.schedule('*/5 * * * *', async () => { await cleanEmailTokens(); return;