diff --git a/core/core-backend/src/main/java/io/dataease/job/schedule/CleanScheduler.java b/core/core-backend/src/main/java/io/dataease/job/schedule/CleanScheduler.java new file mode 100644 index 0000000000..d1c8ecc3f5 --- /dev/null +++ b/core/core-backend/src/main/java/io/dataease/job/schedule/CleanScheduler.java @@ -0,0 +1,21 @@ +package io.dataease.job.schedule; + +import io.dataease.exportCenter.manage.ExportCenterManage; +import io.dataease.utils.LogUtil; +import jakarta.annotation.Resource; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +@Component +public class CleanScheduler { + + @Resource(name = "exportCenterManage") + private ExportCenterManage exportCenterManage; + + @Scheduled(cron = "0 0 0 * * ?") + public void clean() { + LogUtil.info("Start to execute export file cleaner ..."); + exportCenterManage.cleanLog(); + LogUtil.info("Execute export file cleaner success"); + } +} diff --git a/core/core-backend/src/main/resources/db/migration/V2.10__ddl.sql b/core/core-backend/src/main/resources/db/migration/V2.10__ddl.sql new file mode 100644 index 0000000000..734fe6580e --- /dev/null +++ b/core/core-backend/src/main/resources/db/migration/V2.10__ddl.sql @@ -0,0 +1 @@ +INSERT INTO `core_sys_setting` (`id`, `pkey`, `pval`, `type`, `sort`) VALUES (10, 'basic.exportFileLiveTime', '30', 'text', 2);