Skip to content

Commit

Permalink
Fix disabling of cache use and storage
Browse files Browse the repository at this point in the history
  • Loading branch information
shartte committed Jun 1, 2024
1 parent 18acd7d commit f8f1142
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public void performMaintenance() throws IOException {
if (age.compareTo(interval) < 0) {
if (verbose) {
LOG.println("Not performing routine maintenance since the last maintenance was "
+ AnsiColor.BOLD + StringUtil.formatDuration(age) + " ago" + AnsiColor.RESET);
+ AnsiColor.BOLD + StringUtil.formatDuration(age) + " ago" + AnsiColor.RESET);
}
return;
}
Expand Down Expand Up @@ -244,6 +244,10 @@ public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IO
}

public boolean restoreOutputsFromCache(ExecutionNode node, CacheKey cacheKey, Map<String, Path> outputValues) throws IOException {
if (disabled) {
return false;
}

var intermediateCacheDir = getIntermediateResultsDir();
var cacheMarkerFile = getCacheMarkerFile(cacheKey);
Files.createDirectories(intermediateCacheDir);
Expand Down Expand Up @@ -274,6 +278,10 @@ public boolean restoreOutputsFromCache(ExecutionNode node, CacheKey cacheKey, Ma
}

public void saveOutputs(ExecutionNode node, CacheKey cacheKey, HashMap<String, Path> outputValues) throws IOException {
if (disabled) {
return;
}

var intermediateCacheDir = getIntermediateResultsDir();
var finalOutputValues = new HashMap<String, Path>(outputValues.size());
for (var entry : outputValues.entrySet()) {
Expand Down

0 comments on commit f8f1142

Please sign in to comment.