From 2d1fd3f8e433261fa191ac68480308d9cfa3497a Mon Sep 17 00:00:00 2001 From: upagge Date: Fri, 3 Apr 2020 11:32:30 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B5=D0=B1=D0=BE=D0=BB=D1=8C=D1=88?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scheduler/SchedulerComments.java | 19 ++----------------- src/main/resources/logback.xml | 4 ++-- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/tsc/bitbucketbot/scheduler/SchedulerComments.java b/src/main/java/com/tsc/bitbucketbot/scheduler/SchedulerComments.java index 3a1a64d..b6c79da 100644 --- a/src/main/java/com/tsc/bitbucketbot/scheduler/SchedulerComments.java +++ b/src/main/java/com/tsc/bitbucketbot/scheduler/SchedulerComments.java @@ -50,7 +50,7 @@ public class SchedulerComments { long count = 0; do { int page = 0; - Page pullRequestPage = pullRequestsService.getAll(Pagination.of(page++, COUNT)); + Page pullRequestPage = pullRequestsService.getAll(Pagination.of(page, COUNT)); while (pullRequestPage.hasContent()) { for (PullRequest pullRequest : pullRequestPage.getContent()) { final String commentUrl = getCommentUrl(commentId, pullRequest); @@ -63,7 +63,7 @@ public class SchedulerComments { break; } } - pullRequestPage = pullRequestsService.getAll(Pagination.of(page++, COUNT)); + pullRequestPage = pullRequestsService.getAll(Pagination.of(++page, COUNT)); } count++; commentId += 1; @@ -98,8 +98,6 @@ public class SchedulerComments { comment.getAnswers().addAll(answerJsons.stream().map(CommentJson::getId).collect(Collectors.toList())); commentService.save(comment); } - } else { - commentService.delete(comment.getId()); } } } @@ -123,22 +121,9 @@ public class SchedulerComments { } private void notification(@NonNull CommentJson comment, @NonNull PullRequest pullRequest) { -// notificationAuthorPr(comment, pullRequest); notificationPersonal(comment, pullRequest); } - private void notificationAuthorPr(@NonNull CommentJson comment, @NonNull PullRequest pullRequest) { - final Long authorTelegram = pullRequest.getAuthor().getTelegramId(); - if (authorTelegram != null) { - messageSendService.add( - MessageSend.builder() - .telegramId(authorTelegram) - .message(Message.commentPr(comment, pullRequest.getName(), pullRequest.getUrl())) - .build() - ); - } - } - private void notificationPersonal(@NonNull CommentJson comment, @NonNull PullRequest pullRequest) { Matcher matcher = PATTERN.matcher(comment.getText()); while (matcher.find()) { diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml index dc1d3d1..0335154 100644 --- a/src/main/resources/logback.xml +++ b/src/main/resources/logback.xml @@ -6,7 +6,7 @@ - scanner-logs.log + bitbucketbot-logs.log bitbucket.%d{yyyy-MM-dd}.log 10 @@ -18,7 +18,7 @@ - + \ No newline at end of file