From 9d858929796de0081f94fd59590f35a73ade86d8 Mon Sep 17 00:00:00 2001 From: Struchkov Mark Date: Sun, 5 Mar 2023 18:56:20 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D1=80=D0=B0=D0=B7=D0=B4=D0=B5=D0=BB=D0=B5=D0=BD=D0=BD=D0=BE?= =?UTF-8?q?=D0=B5=20=D1=81=D0=BA=D0=B0=D0=BD=D0=B8=D1=80=D0=BE=D0=B2=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gitlab/scheduler/SchedulerService.java | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/gitlab-app/src/main/java/dev/struchkov/bot/gitlab/scheduler/SchedulerService.java b/gitlab-app/src/main/java/dev/struchkov/bot/gitlab/scheduler/SchedulerService.java index 9116efe..e6d9e53 100644 --- a/gitlab-app/src/main/java/dev/struchkov/bot/gitlab/scheduler/SchedulerService.java +++ b/gitlab-app/src/main/java/dev/struchkov/bot/gitlab/scheduler/SchedulerService.java @@ -32,9 +32,9 @@ public class SchedulerService { private final MergeRequestsService mergeRequestsService; private final DiscussionService discussionService; - @Scheduled(cron = "0 */1 * * * *") - public void newMergeRequest() { - log.info("Запуск процесса обновления данных c GitLab"); + @Scheduled(cron = "0 0 */1 * * *") + public void newProjects() { + log.info("Запуск процесса получение новых репозиториев c GitLab"); if (!settingService.isFirstStart()) { if (settingService.isOwnerProjectScan()) { projectParser.parseAllProjectOwner(); @@ -42,8 +42,24 @@ public class SchedulerService { if (settingService.isPrivateProjectScan()) { projectParser.parseAllPrivateProject(); } - mergeRequestParser.parsingOldMergeRequest(); + } + log.info("Конец процесса получение новых репозиториев c GitLab"); + } + + @Scheduled(cron = "0 */15 * * * *") + public void newMergeRequests() { + log.info("Запуск процесса получение новых MR c GitLab"); + if (!settingService.isFirstStart()) { mergeRequestParser.parsingNewMergeRequest(); + } + log.info("Конец процесса получение новых MR c GitLab"); + } + + @Scheduled(cron = "0 */1 * * * *") + public void newMergeRequest() { + log.info("Запуск процесса обновления данных c GitLab"); + if (!settingService.isFirstStart()) { + mergeRequestParser.parsingOldMergeRequest(); pipelineParser.scanOldPipeline(); pipelineParser.scanNewPipeline(); discussionParser.scanOldDiscussions();