diff --git a/core/libs/image-importer/src/main/java/gallerymine/backend/services/ImportService.java b/core/libs/image-importer/src/main/java/gallerymine/backend/services/ImportService.java index 58aa4eb..4b6e420 100644 --- a/core/libs/image-importer/src/main/java/gallerymine/backend/services/ImportService.java +++ b/core/libs/image-importer/src/main/java/gallerymine/backend/services/ImportService.java @@ -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()); } diff --git a/core/libs/image-importer/src/main/java/gallerymine/backend/utils/ImportUtils.java b/core/libs/image-importer/src/main/java/gallerymine/backend/utils/ImportUtils.java index e1d1526..b36670b 100644 --- a/core/libs/image-importer/src/main/java/gallerymine/backend/utils/ImportUtils.java +++ b/core/libs/image-importer/src/main/java/gallerymine/backend/utils/ImportUtils.java @@ -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); } } }