添加日志测试定时任务

This commit is contained in:
liuchengqian 2023-03-08 16:28:55 +08:00
parent 4a628519de
commit 477d0f46ae

View File

@ -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()));
}
}