Skip to content

Commit

Permalink
Fix default value of config
Browse files Browse the repository at this point in the history
  • Loading branch information
nck-mlcnv committed Sep 5, 2024
1 parent 31676aa commit bbc7a20
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/main/java/org/aksw/iguana/cc/query/handler/QueryHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public record Pattern(@JsonProperty(required = true) URI endpoint, Long limit, B
public Pattern(URI endpoint, Long limit, Boolean caching) {
this.endpoint = endpoint;
this.limit = limit == null ? 2000 : limit;
this.caching = true;
this.caching = caching == null || caching;
}
}
}
Expand Down Expand Up @@ -184,19 +184,20 @@ public QueryHandler(Config config) throws IOException {
if (Files.exists(instancePath)) {
LOGGER.info("Already existing query pattern instances have been found and will be reused. Delete the following file to regenerate them: {}", instancePath);
querySource = createQuerySource(instancePath);
}
final List<String> instances = instantiatePatternQueries(querySource, config.pattern);
if (config.pattern.caching) {
Files.createFile(instancePath);
try (var writer = Files.newBufferedWriter(instancePath)) {
for (String instance : instances) {
writer.write(instance);
writer.newLine();
} else {
final List<String> instances = instantiatePatternQueries(querySource, config.pattern);
if (config.pattern.caching) {
Files.createFile(instancePath);
try (var writer = Files.newBufferedWriter(instancePath)) {
for (String instance : instances) {
writer.write(instance);
writer.newLine();
}
}
querySource = createQuerySource(instancePath);
} else {
querySource = new StringListQuerySource(instances);
}
querySource = createQuerySource(instancePath);
} else {
querySource = new StringListQuerySource(instances);
}
}

Expand Down

0 comments on commit bbc7a20

Please sign in to comment.