From 83850f2981ded0b6624556ee3430f684752b8ea3 Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Sun, 20 Oct 2024 22:29:07 +0800 Subject: [PATCH] refactor: update cronjob clear time --- src/server/cronjob/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/cronjob/index.ts b/src/server/cronjob/index.ts index ddfa3d3..fd24e87 100644 --- a/src/server/cronjob/index.ts +++ b/src/server/cronjob/index.ts @@ -242,14 +242,14 @@ async function statDailyUsage() { } /** - * Clear over 2 week data + * Clear over 1 month data */ async function clearMonitorDataDaily() { if (env.disableAutoClear) { return; } - const date = dayjs().subtract(2, 'weeks').toDate(); + const date = dayjs().subtract(1, 'months').toDate(); logger.info( '[clearMonitorDataDaily] Start clear monitor data before:', date.toISOString() @@ -269,14 +269,14 @@ async function clearMonitorDataDaily() { } /** - * Clear over 2 week data + * Clear over 1 month data */ async function clearMonitorEventDaily() { if (env.disableAutoClear) { return; } - const date = dayjs().subtract(2, 'weeks').toDate(); + const date = dayjs().subtract(1, 'month').toDate(); logger.info( '[clearMonitorEventDaily] Start clear monitor data before:', date.toISOString()