From 477d0f46ae74bed1c8428d7007668993a58ee200 Mon Sep 17 00:00:00 2001 From: liuchengqian Date: Wed, 8 Mar 2023 16:28:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=97=A5=E5=BF=97=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/xkrs/common/StaticScheduleTask.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/xkrs/common/StaticScheduleTask.java b/src/main/java/com/xkrs/common/StaticScheduleTask.java index d128c5d..3752899 100644 --- a/src/main/java/com/xkrs/common/StaticScheduleTask.java +++ b/src/main/java/com/xkrs/common/StaticScheduleTask.java @@ -3,6 +3,8 @@ package com.xkrs.common; import com.xkrs.helper.FirePointSubscribeManager; import com.xkrs.utilsnew.DateTimeUtils; import com.xkrs.utilsnew.WeiXinMessageUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.context.annotation.Configuration; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.Scheduled; @@ -26,7 +28,7 @@ public class StaticScheduleTask { firePointSubscribeManager.autoSync(); } - //每小时更新一次订阅 + //每小时测试一次微信消息推送 @Scheduled(cron = "0 0 * * * ?") private void testPushWeiXinMessage() { try { @@ -34,8 +36,12 @@ public class StaticScheduleTask { } catch (Exception e) { e.printStackTrace(); } - } + @Scheduled(cron = "*/3 * * * * ?") + private void test() { + Logger log = LoggerFactory.getLogger(StaticScheduleTask.class); + log.info("微信发消息测试5 " + DateTimeUtils.localDateTimeToString(LocalDateTime.now())); + } } \ No newline at end of file