From e29733bb35d3caa0af3e941013a0cbfee64486aa Mon Sep 17 00:00:00 2001 From: x ronger Date: Sat, 28 Mar 2020 13:38:29 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=20=E6=B5=8B=E8=AF=95=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E4=B8=8D=E5=AE=9A=E6=97=B6=E6=8E=A8=E9=80=81=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/rymcu/vertical/task/BaiduCronTask.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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); + } } }