Skip to content

Commit

Permalink
#28 replace files with symlinks after approve process
Browse files Browse the repository at this point in the history
  • Loading branch information
spuliaiev-sfdc committed Jul 20, 2018
1 parent 910924f commit 36b8c08
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,12 @@ public void checkSubsAndDone(String requestId, ImportRequest child, ProcessType
Process process = processRepository.findByIdInAndTypeIs(request.getIndexProcessIds(), processType);
log.info(" finishing process id={} path={} processId={} processType={}",
requestId, request.getPath(), process.getId(), process.getType());
process = finishProcess(request, process);
// First do all needed operations
onRootImportFinished(request, process);
// Then - mark as finished.
finishProcess(request, process);
// TODO: If first failed - we will be able to find abandoned process and finish it
// as part of pool job
}
log.info(" checkSubsAndDone complete for id={} path={}", requestId, request.getPath());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,10 @@ public void moveFileStructure(Path source, Path target, AtomicLong files, Atomic
if (!appConfig.isDryRunImportMoves()) {
FileUtils.moveFileToDirectory(srcFile.toFile(), target.toFile(), true);
} else {
// Simply create symlynk
Files.createSymbolicLink(target.resolve(srcFile.getFileName()), srcFile);
// Simply create sym-link
// Files.createSymbolicLink(target.resolve(srcFile.getFileName()), srcFile);
// Simply create hard-link
Files.createLink(target.resolve(srcFile.getFileName()), srcFile);
}
}
}
Expand Down

0 comments on commit 36b8c08

Please sign in to comment.