From 59c414a34662574b034ff4bee0c75ad0b38fa389 Mon Sep 17 00:00:00 2001 From: bulatruslanovich Date: Fri, 18 Oct 2024 11:23:59 +0300 Subject: [PATCH] fix: clean cache after block, filter only active user's configs --- dispatcher/build.gradle | 1 + node/build.gradle | 1 + .../main/java/com/bipbup/service/bot/impl/MainServiceImpl.java | 1 + .../java/com/bipbup/service/bot/impl/NotifierServiceImpl.java | 1 + 4 files changed, 4 insertions(+) diff --git a/dispatcher/build.gradle b/dispatcher/build.gradle index 1fcbcd7..3bfcab8 100644 --- a/dispatcher/build.gradle +++ b/dispatcher/build.gradle @@ -25,6 +25,7 @@ configurations { } repositories { + mavenLocal() mavenCentral() } diff --git a/node/build.gradle b/node/build.gradle index 67eb6f7..5b15378 100644 --- a/node/build.gradle +++ b/node/build.gradle @@ -26,6 +26,7 @@ configurations { } repositories { + mavenLocal() mavenCentral() } diff --git a/node/src/main/java/com/bipbup/service/bot/impl/MainServiceImpl.java b/node/src/main/java/com/bipbup/service/bot/impl/MainServiceImpl.java index e7a3803..7cd8cb4 100644 --- a/node/src/main/java/com/bipbup/service/bot/impl/MainServiceImpl.java +++ b/node/src/main/java/com/bipbup/service/bot/impl/MainServiceImpl.java @@ -94,6 +94,7 @@ public void processCallbackQuery(Update update) { var state = userStateCacheService.getUserState(user.getTelegramId()); if (callbackData.equals("deactivate_me")) { + userStateCacheService.clearUserState(user.getTelegramId()); userService.deactivate(user); return; } diff --git a/node/src/main/java/com/bipbup/service/bot/impl/NotifierServiceImpl.java b/node/src/main/java/com/bipbup/service/bot/impl/NotifierServiceImpl.java index 2843a0f..b74ffa1 100644 --- a/node/src/main/java/com/bipbup/service/bot/impl/NotifierServiceImpl.java +++ b/node/src/main/java/com/bipbup/service/bot/impl/NotifierServiceImpl.java @@ -43,6 +43,7 @@ public void searchNewVacancies() { while (!configs.isEmpty()) { configs.stream() .filter(this::queryExist) + .filter(config -> config.getAppUser().getActive()) .forEach(this::processNewVacancies); configs = configService.getConfigsFromPage(page, SIZE_OF_PAGE);