refactor: update cronjob clear time
This commit is contained in:
parent
3dca8fc27c
commit
83850f2981
@ -242,14 +242,14 @@ async function statDailyUsage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clear over 2 week data
|
* Clear over 1 month data
|
||||||
*/
|
*/
|
||||||
async function clearMonitorDataDaily() {
|
async function clearMonitorDataDaily() {
|
||||||
if (env.disableAutoClear) {
|
if (env.disableAutoClear) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const date = dayjs().subtract(2, 'weeks').toDate();
|
const date = dayjs().subtract(1, 'months').toDate();
|
||||||
logger.info(
|
logger.info(
|
||||||
'[clearMonitorDataDaily] Start clear monitor data before:',
|
'[clearMonitorDataDaily] Start clear monitor data before:',
|
||||||
date.toISOString()
|
date.toISOString()
|
||||||
@ -269,14 +269,14 @@ async function clearMonitorDataDaily() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clear over 2 week data
|
* Clear over 1 month data
|
||||||
*/
|
*/
|
||||||
async function clearMonitorEventDaily() {
|
async function clearMonitorEventDaily() {
|
||||||
if (env.disableAutoClear) {
|
if (env.disableAutoClear) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const date = dayjs().subtract(2, 'weeks').toDate();
|
const date = dayjs().subtract(1, 'month').toDate();
|
||||||
logger.info(
|
logger.info(
|
||||||
'[clearMonitorEventDaily] Start clear monitor data before:',
|
'[clearMonitorEventDaily] Start clear monitor data before:',
|
||||||
date.toISOString()
|
date.toISOString()
|
||||||
|
Loading…
Reference in New Issue
Block a user