From 664db98c9e8595ce4dd636a27f480e3a08b81ff5 Mon Sep 17 00:00:00 2001 From: xyc <jc_xiong@hotmail.com> Date: 星期五, 21 二月 2025 11:13:51 +0800 Subject: [PATCH] 新增可忽略的维修时间 --- starter/src/main/java/com/zt/life/AdminApplication.java | 20 ++++++++------------ 1 files changed, 8 insertions(+), 12 deletions(-) diff --git a/starter/src/main/java/com/zt/life/AdminApplication.java b/starter/src/main/java/com/zt/life/AdminApplication.java index 7ed8ad2..7dfdcac 100644 --- a/starter/src/main/java/com/zt/life/AdminApplication.java +++ b/starter/src/main/java/com/zt/life/AdminApplication.java @@ -19,10 +19,9 @@ import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.serializer.StringRedisSerializer; import org.springframework.scheduling.annotation.EnableAsync; -import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.scheduling.annotation.EnableScheduling; import java.io.File; -import java.text.ParseException; /** * @author hehz @@ -34,6 +33,7 @@ org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class}) @EnableCaching @EnableAsync +@EnableScheduling public class AdminApplication extends SpringBootServletInitializer { @Value("${zt.oss.local-path}") @@ -59,12 +59,12 @@ return factory; } - @Scheduled(cron = "0 0 3 * * ?") //姣忓ぉ3鐐规墽琛� - public void timerListener() throws ParseException { -/* projectService.dropTemporaryTable(); - projectService.updateHasLifeData(); - this.deleteTempFile();*/ - } +// @Scheduled(cron = "0 0 3 * * ?") //姣忓ぉ3鐐规墽琛� +// public void timerListener() throws ParseException { +///* projectService.dropTemporaryTable(); +// projectService.updateHasLifeData(); +// this.deleteTempFile();*/ +// } private void deleteTempFile() { String tempUploadDir = localPath + File.separator + "TEMP_UPLOAD"; @@ -78,10 +78,6 @@ @Bean public RedisTemplate<String, Object> redisTemplate() { - try { - this.timerListener(); - } catch (Exception e) { - } RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>(); // 鏆傛椂鍏堣缃甼ey鍜寁alue鐨勫簭鍒楀寲閮芥槸瀛楃涓� redisTemplate.setKeySerializer(new StringRedisSerializer()); -- Gitblit v1.9.1