Skip to content

Commit

Permalink
removed AvailabilityListener from CypherProceduresHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
vga91 committed Dec 6, 2024
1 parent f202ebf commit c53f2c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ ext {
// NB: due to version.json generation by parsing this file, the next line must not have any if/then/else logic
neo4jVersion = "5.26.0"
// instead we apply the override logic here
neo4jVersionEffective = project.hasProperty("neo4jVersionOverride") ? project.getProperty("neo4jVersionOverride") : neo4jVersion + "-SNAPSHOT"
neo4jVersionEffective = project.hasProperty("neo4jVersionOverride") ? project.getProperty("neo4jVersionOverride") : neo4jVersion
testContainersVersion = '1.20.2'
apacheArrowVersion = '15.0.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import org.neo4j.kernel.api.procedure.CallableUserFunction;
import org.neo4j.kernel.api.procedure.Context;
import org.neo4j.kernel.api.procedure.GlobalProcedures;
import org.neo4j.kernel.availability.AvailabilityListener;
import org.neo4j.kernel.impl.util.ValueUtils;
import org.neo4j.kernel.internal.GraphDatabaseAPI;
import org.neo4j.kernel.lifecycle.LifecycleAdapter;
Expand Down Expand Up @@ -63,7 +62,7 @@
import static org.neo4j.internal.kernel.api.procs.Neo4jTypes.NTAny;
import static org.neo4j.internal.kernel.api.procs.Neo4jTypes.NTMap;

public class CypherProceduresHandler extends LifecycleAdapter implements AvailabilityListener {
public class CypherProceduresHandler extends LifecycleAdapter {
public static final String PREFIX = "custom";
public static final String FUNCTION = "function";
public static final String PROCEDURE = "procedure";
Expand Down Expand Up @@ -95,7 +94,7 @@ public CypherProceduresHandler(GraphDatabaseAPI db, JobScheduler jobScheduler, A
}

@Override
public void available() {
public void start() {
restoreProceduresAndFunctions();
long refreshInterval = apocConfig().getInt(CUSTOM_PROCEDURES_REFRESH, 60000);
restoreProceduresHandle = jobScheduler.scheduleRecurring(REFRESH_GROUP, () -> {
Expand All @@ -106,7 +105,7 @@ public void available() {
}

@Override
public void unavailable() {
public void stop() {
if (restoreProceduresHandle != null) {
restoreProceduresHandle.cancel();
}
Expand Down

0 comments on commit c53f2c7

Please sign in to comment.