This commit is contained in:
2026-03-10 17:27:14 +09:00
parent cb2e42143a
commit 8a63fdacdd

View File

@@ -70,7 +70,7 @@ public class TmpDatasetService {
throw new IOException("No symlinks created."); throw new IOException("No symlinks created.");
} }
log.info("tmp dataset created: {}, symlinksMade={}", tmp, linksMade); log.info("tmp dataset created: {}, linksMade={}", tmp, linksMade);
} }
private long link(Path tmp, String type, String part, String fullPath) throws IOException { private long link(Path tmp, String type, String part, String fullPath) throws IOException {
@@ -92,28 +92,12 @@ public class TmpDatasetService {
Files.delete(dst); Files.delete(dst);
} }
try {
Files.createLink(dst, src);
log.info("hardlink created: {} -> {}", dst, src);
} catch (FileSystemException e) {
if (e.getMessage() != null && e.getMessage().contains("Invalid cross-device link")) {
log.warn(
"Hardlink failed due to cross-device link. Fallback to symlink. src={}, dst={}",
src,
dst);
Files.createSymbolicLink(dst, src); Files.createSymbolicLink(dst, src);
} else { log.info("symlink created: {} -> {}", dst, src);
throw e;
}
}
return 1; return 1;
} }
private String safe(String s) {
return (s == null || s.isBlank()) ? null : s.trim();
}
/** /**
* request 전체 폴더 link * request 전체 폴더 link
* *