diff --git a/src/main/java/com/rymcu/forest/config/VisitableThreadPoolTaskExecutor.java b/src/main/java/com/rymcu/forest/config/VisitableThreadPoolTaskExecutor.java index 8e47aea..bc12f9a 100644 --- a/src/main/java/com/rymcu/forest/config/VisitableThreadPoolTaskExecutor.java +++ b/src/main/java/com/rymcu/forest/config/VisitableThreadPoolTaskExecutor.java @@ -19,9 +19,8 @@ import java.util.concurrent.ThreadPoolExecutor; public class VisitableThreadPoolTaskExecutor extends ThreadPoolTaskExecutor { private static final Logger logger = LoggerFactory.getLogger(VisitableThreadPoolTaskExecutor.class); - private void showThreadPoolInfo(String prefix){ + private void showThreadPoolInfo(String prefix) { ThreadPoolExecutor threadPoolExecutor = getThreadPoolExecutor(); - logger.info("{}, {},taskCount [{}], completedTaskCount [{}], activeCount [{}], queueSize [{}]", this.getThreadNamePrefix(), prefix, diff --git a/src/main/java/com/rymcu/forest/core/result/GlobalResult.java b/src/main/java/com/rymcu/forest/core/result/GlobalResult.java index 2e52f6f..faab103 100644 --- a/src/main/java/com/rymcu/forest/core/result/GlobalResult.java +++ b/src/main/java/com/rymcu/forest/core/result/GlobalResult.java @@ -21,7 +21,7 @@ public class GlobalResult { } public static GlobalResult newInstance() { - return new GlobalResult(); + return new GlobalResult<>(); } } diff --git a/src/main/java/com/rymcu/forest/core/service/redis/RedisService.java b/src/main/java/com/rymcu/forest/core/service/redis/RedisService.java index c005437..e5f64bf 100644 --- a/src/main/java/com/rymcu/forest/core/service/redis/RedisService.java +++ b/src/main/java/com/rymcu/forest/core/service/redis/RedisService.java @@ -134,7 +134,7 @@ public interface RedisService { * @param expireTime 缓存内容过期时间 (单位:秒) ,若expireTime小于0 则表示该内容不过期 * @return */ - String set(String key, Object obj, int expireTime); + String set(String key, Object obj, long expireTime); /** @@ -145,7 +145,7 @@ public interface RedisService { * @param expireTime 缓存内容过期时间 (单位:秒) ,若expireTime小于0 则表示该内容不过期 * @return */ - String set(String key, String value, int expireTime); + String set(String key, String value, long expireTime); /** * 写入/修改 缓存内容 @@ -212,7 +212,7 @@ public interface RedisService { * @param key * @param seconds */ - void setTTL(String key, int seconds); + void setTTL(String key, long seconds); /** * 根据通配符表达式查询key值的set,通配符仅支持* diff --git a/src/main/java/com/rymcu/forest/core/service/redis/impl/RedisServiceImpl.java b/src/main/java/com/rymcu/forest/core/service/redis/impl/RedisServiceImpl.java index 6c36f11..7cacb08 100644 --- a/src/main/java/com/rymcu/forest/core/service/redis/impl/RedisServiceImpl.java +++ b/src/main/java/com/rymcu/forest/core/service/redis/impl/RedisServiceImpl.java @@ -163,7 +163,7 @@ public class RedisServiceImpl implements RedisService { * @return */ @Override - public String set(String key, Object obj, int expireTime) { + public String set(String key, Object obj, long expireTime) { String value = RedisService.BLANK_CONTENT; if (obj != null) { try { @@ -184,7 +184,7 @@ public class RedisServiceImpl implements RedisService { * @return */ @Override - public String set(String key, String value, int expireTime) { + public String set(String key, String value, long expireTime) { if (StringUtils.isBlank(key)) { logger.warn("Params key is blank!"); return null; @@ -460,7 +460,7 @@ public class RedisServiceImpl implements RedisService { * @param seconds */ @Override - public void setTTL(String key, int seconds) { + public void setTTL(String key, long seconds) { if (seconds < 0) { return; } diff --git a/src/main/java/com/rymcu/forest/task/BaiDuCronTask.java b/src/main/java/com/rymcu/forest/task/BaiDuCronTask.java deleted file mode 100644 index ce7127f..0000000 --- a/src/main/java/com/rymcu/forest/task/BaiDuCronTask.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.rymcu.forest.task; - -import com.rymcu.forest.core.constant.ProjectConstant; -import com.rymcu.forest.util.BaiDuUtils; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.scheduling.annotation.Scheduled; - -/** - * @author ronger - */ -//@Component -@Slf4j -public class BaiDuCronTask { - - @Value("${resource.domain}") - private String domain; - @Value(("${env}")) - private String env; - - /** - * 定时推送首页更新 - */ - @Scheduled(cron = "0 0 10,14,18 * * ?") - public void pushHome() { - if (!ProjectConstant.ENV.equals(env)) { - BaiDuUtils.sendUpdateSEOData(domain); - } - } - -}