Skip to content

Commit

Permalink
fixes #1606 add database name when calling dbms.cluster.role (#1613)
Browse files Browse the repository at this point in the history
  • Loading branch information
sarmbruster authored and mneedham committed Aug 10, 2020
1 parent 2adbf42 commit c6d3b4f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/src/main/java/apoc/util/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,8 @@ public static boolean isWriteableInstance(GraphDatabaseAPI db) {
/* ignore */
}

String role = db.executeTransactionally("CALL dbms.cluster.role()", Collections.emptyMap(),
String role = db.executeTransactionally("CALL dbms.cluster.role($databaseName)",
Collections.singletonMap("databaseName", db.databaseName()),
result -> Iterators.single(result.columnAs("role")));
return role.equalsIgnoreCase("LEADER");
} catch(QueryExecutionException e) {
Expand Down

0 comments on commit c6d3b4f

Please sign in to comment.