diff --git a/src/main/java/com/kwan/springbootkwan/schedule/CsdnSchedule.java b/src/main/java/com/kwan/springbootkwan/schedule/CsdnSchedule.java index 2ae9aba38ff390a5d296d6425b35d77cf3392dee..b50db83ce18f8d2c316bcb681a19500f179cc59a 100644 --- a/src/main/java/com/kwan/springbootkwan/schedule/CsdnSchedule.java +++ b/src/main/java/com/kwan/springbootkwan/schedule/CsdnSchedule.java @@ -36,9 +36,13 @@ public class CsdnSchedule { log.info("execute task is finish ... ..."); } - /** - * 当天可能有新的发布 - */ + @Scheduled(cron = "0 0/30 0 * * ?") + public void executeReply() { + log.info("executeReply task is running ... ..."); + csdnCommentService.commentSelf(); + log.info("executeReply task is finish ... ..."); + } + @Scheduled(cron = "0 0/30 * * * ?") public void executeInit() { log.info("executeInit task is running ... ..."); @@ -55,12 +59,5 @@ public class CsdnSchedule { } log.info("executeInit task is finish ... ..."); } - - @Scheduled(cron = "0 0 8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23 * * ?") - public void executeReply() { - log.info("executeReply task is running ... ..."); - csdnCommentService.commentSelf(); - log.info("executeReply task is finish ... ..."); - } } diff --git a/src/main/java/com/kwan/springbootkwan/service/impl/CsdnCommentServiceImpl.java b/src/main/java/com/kwan/springbootkwan/service/impl/CsdnCommentServiceImpl.java index 4c0d3ce0a666a7f095b45f4401730033a7062995..7afb4df8811594f431e1de129ceb8c9cafdebe38 100644 --- a/src/main/java/com/kwan/springbootkwan/service/impl/CsdnCommentServiceImpl.java +++ b/src/main/java/com/kwan/springbootkwan/service/impl/CsdnCommentServiceImpl.java @@ -139,7 +139,6 @@ public class CsdnCommentServiceImpl implements CsdnCommentService { .header("Cookie", csdnCookie) .form("page", 1) .form("size", 100) - .form("fold", "unfold") .execute(); final String body = response.body(); ObjectMapper objectMapper = new ObjectMapper();