diff --git a/src/main/java/com/rymcu/vertical/task/BaiduCronTask.java b/src/main/java/com/rymcu/vertical/task/BaiduCronTask.java index b261652..9ef02a1 100644 --- a/src/main/java/com/rymcu/vertical/task/BaiduCronTask.java +++ b/src/main/java/com/rymcu/vertical/task/BaiduCronTask.java @@ -1,5 +1,6 @@ package com.rymcu.vertical.task; +import com.rymcu.vertical.core.constant.ProjectConstant; import com.rymcu.vertical.util.BaiDuUtils; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; @@ -12,13 +13,17 @@ public class BaiduCronTask { @Value("${resource.domain}") private String domain; + @Value(("${env}")) + private String env; /** * 定时推送首页更新 * */ @Scheduled(cron = "0 0 10,14,18 * * ?") public void pushHome() { - BaiDuUtils.updateSEOData(domain); + if (!ProjectConstant.ENV.equals(env)) { + BaiDuUtils.updateSEOData(domain); + } } }