From 4c890a5fe2dec7ef621bda29738c61164d87c821 Mon Sep 17 00:00:00 2001 From: RadovanTomik Date: Tue, 21 May 2024 16:29:39 +0200 Subject: [PATCH] fix(notifications): remove async notification sending Signed-off-by: RadovanTomik --- .../negotiator/NegotiatorApplication.java | 2 -- .../configuration/AsyncEventsConfig.java | 18 ------------------ .../service/ResourceLifecycleServiceImpl.java | 2 -- 3 files changed, 22 deletions(-) delete mode 100644 src/main/java/eu/bbmri_eric/negotiator/configuration/AsyncEventsConfig.java diff --git a/src/main/java/eu/bbmri_eric/negotiator/NegotiatorApplication.java b/src/main/java/eu/bbmri_eric/negotiator/NegotiatorApplication.java index c0356adb9..4a152be1f 100644 --- a/src/main/java/eu/bbmri_eric/negotiator/NegotiatorApplication.java +++ b/src/main/java/eu/bbmri_eric/negotiator/NegotiatorApplication.java @@ -4,14 +4,12 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.domain.EntityScan; import org.springframework.data.jpa.repository.config.EnableJpaRepositories; -import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableScheduling; @SpringBootApplication @EntityScan(basePackages = {"eu.bbmri_eric.negotiator.database.*"}) @EnableJpaRepositories(basePackages = {"eu.bbmri_eric.negotiator.database.repository"}) @EnableScheduling -@EnableAsync public class NegotiatorApplication { public static void main(String[] args) { diff --git a/src/main/java/eu/bbmri_eric/negotiator/configuration/AsyncEventsConfig.java b/src/main/java/eu/bbmri_eric/negotiator/configuration/AsyncEventsConfig.java deleted file mode 100644 index 798205de5..000000000 --- a/src/main/java/eu/bbmri_eric/negotiator/configuration/AsyncEventsConfig.java +++ /dev/null @@ -1,18 +0,0 @@ -package eu.bbmri_eric.negotiator.configuration; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.event.ApplicationEventMulticaster; -import org.springframework.context.event.SimpleApplicationEventMulticaster; -import org.springframework.core.task.SimpleAsyncTaskExecutor; - -@Configuration -public class AsyncEventsConfig { - @Bean(name = "applicationEventMulticaster") - public ApplicationEventMulticaster simpleApplicationEventMulticaster() { - SimpleApplicationEventMulticaster eventMulticaster = new SimpleApplicationEventMulticaster(); - - eventMulticaster.setTaskExecutor(new SimpleAsyncTaskExecutor()); - return eventMulticaster; - } -} diff --git a/src/main/java/eu/bbmri_eric/negotiator/service/ResourceLifecycleServiceImpl.java b/src/main/java/eu/bbmri_eric/negotiator/service/ResourceLifecycleServiceImpl.java index 2e08c4bfe..8b7b8e6d8 100644 --- a/src/main/java/eu/bbmri_eric/negotiator/service/ResourceLifecycleServiceImpl.java +++ b/src/main/java/eu/bbmri_eric/negotiator/service/ResourceLifecycleServiceImpl.java @@ -129,8 +129,6 @@ private boolean isSecurityRuleMet( creatorId = NegotiatorUserDetailsService.getCurrentlyAuthenticatedUserInternalId(); } catch (ClassCastException e) { return false; - } catch (NullPointerException e) { - return true; } return negotiationRepository.existsByIdAndCreatedBy_Id(negotiationId, creatorId); } else if (securityRule.getExpression().equals("isRepresentative")) {