fix: Sent bookmark updated event only while bookmarks are locked.

This commit is contained in:
Michael Simons
2023-10-19 18:16:59 +02:00
parent 5c3982b213
commit 42d936ade4

View File

@@ -60,9 +60,9 @@ final class ReactiveDefaultBookmarkManager extends AbstractBookmarkManager {
synchronized (this.bookmarks) {
usedBookmarks.stream().filter(Objects::nonNull).forEach(bookmarks::remove);
newBookmarks.stream().filter(Objects::nonNull).forEach(bookmarks::add);
}
if (applicationEventPublisher != null) {
applicationEventPublisher.publishEvent(new Neo4jBookmarksUpdatedEvent(new HashSet<>(bookmarks)));
if (applicationEventPublisher != null) {
applicationEventPublisher.publishEvent(new Neo4jBookmarksUpdatedEvent(new HashSet<>(bookmarks)));
}
}
}