Skip to content

Commit

Permalink
Update to behave differently for APOC extended (#700)
Browse files Browse the repository at this point in the history
  • Loading branch information
gem-neo4j committed Dec 10, 2024
1 parent e55bdf4 commit c8b2ca7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions common/src/main/java/apoc/ApocExtensionFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,23 @@ public void start() {
});

AvailabilityGuard availabilityGuard = dependencies.availabilityGuard();
// APOC core has a listener that is not also a service, so this is registered here.
for (ApocGlobalComponents c : apocGlobalComponents) {
for (AvailabilityListener listener : c.getListeners(db, dependencies)) {
registeredListeners.add(listener);
availabilityGuard.addListener(listener);
}
}

// For APOC extended, the Cypher Procedures listener is both a service and a listener
// To stop needing to keep a Map containing it as an object, which stops it being
// cleaned up, we check for all APOC services which are also listeners and register them here
for (Object service : services.values()) {
if (service instanceof AvailabilityListener serviceWithAvailabilityListener) {
registeredListeners.add(serviceWithAvailabilityListener);
availabilityGuard.addListener(serviceWithAvailabilityListener);
}
}
}

@Override
Expand Down

0 comments on commit c8b2ca7

Please sign in to comment.