Skip to content

Commit

Permalink
Write router config if config is already embedded in the graph
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcel Radischat committed Sep 5, 2016
1 parent 6d1828b commit 2a314df
Showing 1 changed file with 6 additions and 4 deletions.
Expand Up @@ -223,12 +223,14 @@ private Router loadGraph() {
// Even if a config file is not present on disk one could be bundled inside.
try (InputStream is = streams.getConfigInputStream()) {
JsonNode config = MissingNode.getInstance();
// TODO reuse the exact same JSON loader from OTPConfigurator
ObjectMapper mapper = new ObjectMapper();
mapper.configure(JsonParser.Feature.ALLOW_COMMENTS, true);
mapper.configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true);
if (is != null) {
// TODO reuse the exact same JSON loader from OTPConfigurator
ObjectMapper mapper = new ObjectMapper();
mapper.configure(JsonParser.Feature.ALLOW_COMMENTS, true);
mapper.configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true);
config = mapper.readTree(is);
} else if (newGraph.routerConfig != null) {
config = mapper.readTree(newGraph.routerConfig);
}
Router newRouter = new Router(routerId, newGraph);
newRouter.startup(config);
Expand Down

0 comments on commit 2a314df

Please sign in to comment.