Skip to content

Commit 3c7c448

Browse files
committed
GH-629 - Improve repository interaction in DefaultEventPublicationRegistry.
DefaultEventPublicationRegistry is now directly invoking the corresponding repository to delete events older than a certain duration.
1 parent adb8411 commit 3c7c448

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

spring-modulith-events/spring-modulith-events-core/src/main/java/org/springframework/modulith/events/core/DefaultEventPublicationRegistry.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,7 @@ public void deletePublicationsOlderThan(Duration duration) {
158158

159159
var now = clock.instant();
160160

161-
deletePublications(event -> event.getCompletionDate()
162-
.filter(date -> date.isBefore(now.minus(duration)))
163-
.isPresent());
161+
events.deleteCompletedPublicationsBefore(now.minus(duration));
164162
}
165163

166164
/*

0 commit comments

Comments
 (0)