diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/SubscriberRunner.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/SubscriberRunner.kt index fe04ccbc..7a7caedf 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/SubscriberRunner.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/SubscriberRunner.kt @@ -38,7 +38,6 @@ class SubscriberRunner( logger.debug("{}{}{}", header, value, footer) } - } companion object { diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/TimelineRelationshipFollowSubscriber.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/TimelineRelationshipFollowSubscriber.kt index cbef86c0..c58b1b0f 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/TimelineRelationshipFollowSubscriber.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/application/domainevent/subscribers/TimelineRelationshipFollowSubscriber.kt @@ -22,7 +22,6 @@ class TimelineRelationshipFollowSubscriber( domainEventSubscriber.subscribe(RelationshipEvent.ACCEPT_FOLLOW.eventName, this) } - override suspend fun invoke(p1: DomainEvent) { val relationship = p1.body.getRelationship() val userDetail = userDetailRepository.findByActorId(relationship.actorId.id) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/springframework/domainevent/SpringFrameworkDomainEventPublisher.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/springframework/domainevent/SpringFrameworkDomainEventPublisher.kt index b278e1d9..82213901 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/springframework/domainevent/SpringFrameworkDomainEventPublisher.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/springframework/domainevent/SpringFrameworkDomainEventPublisher.kt @@ -32,7 +32,8 @@ class SpringFrameworkDomainEventPublisher(private val applicationEventPublisher: val requestId: String? = MDC.get(ApplicationRequestLogInterceptor.requestId) val springDomainEvent = SpringDomainEvent( - requestId, domainEvent + requestId, + domainEvent ) applicationEventPublisher.publishEvent(springDomainEvent) @@ -43,4 +44,4 @@ class SpringFrameworkDomainEventPublisher(private val applicationEventPublisher: } } -data class SpringDomainEvent(val requestId: String?, val domainEvent: DomainEvent<*>) \ No newline at end of file +data class SpringDomainEvent(val requestId: String?, val domainEvent: DomainEvent<*>) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/springframework/domainevent/SpringFrameworkDomainEventSubscriber.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/springframework/domainevent/SpringFrameworkDomainEventSubscriber.kt index c0617ec0..4230303a 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/springframework/domainevent/SpringFrameworkDomainEventSubscriber.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/springframework/domainevent/SpringFrameworkDomainEventSubscriber.kt @@ -22,13 +22,10 @@ class SpringFrameworkDomainEventSubscriber : DomainEventSubscriber { map.getOrPut(eventName) { mutableListOf() }.add(domainEventConsumer as DomainEventConsumer<*>) } - override fun getSubscribers(): Map>> { - return map - } + override fun getSubscribers(): Map>> = map @EventListener suspend fun onDomainEventPublished(domainEvent: SpringDomainEvent) { - logger.debug( "Domain Event Published: {} id: {} requestId: {}", domainEvent.domainEvent.name, @@ -36,7 +33,6 @@ class SpringFrameworkDomainEventSubscriber : DomainEventSubscriber { domainEvent.requestId ) coroutineScope { - map[domainEvent.domainEvent.name]?.map { async(MDCContext()) { try { @@ -50,7 +46,6 @@ class SpringFrameworkDomainEventSubscriber : DomainEventSubscriber { } } }?.awaitAll() - } }