|
|
@@ -88,6 +88,7 @@ public class HddFlushService {
|
|
|
|
|
|
UploadDoneResult uploadDoneResult = new UploadDoneResult(uploadId, sha256sum, absolutePath, size, hostPort);
|
|
|
consoleService.updateAfterMove(uploadDoneResult);
|
|
|
+ Files.deleteIfExists(Path.of(ssdPath));
|
|
|
} catch (InsufficientSpaceException e) {
|
|
|
log.error("HDD 空间不足,取消搬运: {}", e.getMessage());
|
|
|
} catch (Exception e) {
|
|
|
@@ -103,14 +104,14 @@ public class HddFlushService {
|
|
|
* @return
|
|
|
* @date 2026-04-28 11:48:43
|
|
|
*/
|
|
|
- public void moveSsdToHdd(String uploadId, String sha256sum, long size, String tempPath) {
|
|
|
+ public void moveSsdToHdd(String uploadId, String sha256sum, long size, String ssdTempPath) {
|
|
|
moveExecutor.submit(() -> {
|
|
|
try {
|
|
|
String destPath = diskService.getHddDataPath(sha256sum);
|
|
|
Path targetPath = Path.of(destPath);
|
|
|
|
|
|
checkDiskSpace(size, destPath);
|
|
|
- Path srcPath = Paths.get(tempPath);
|
|
|
+ Path srcPath = Paths.get(ssdTempPath);
|
|
|
// ssd 到 hdd 的跨磁盘拷贝, 此时 SSD 文件完好,getVideoInfo 随时可以并发读取它
|
|
|
Files.copy(srcPath, targetPath, StandardCopyOption.REPLACE_EXISTING);
|
|
|
UploadDoneResult uploadDoneResult = new UploadDoneResult(uploadId, sha256sum, destPath, size, hostPort);
|
|
|
@@ -120,7 +121,7 @@ public class HddFlushService {
|
|
|
// 最后,安全地删除 SSD 临时文件
|
|
|
Files.deleteIfExists(srcPath);
|
|
|
} catch (Exception e) {
|
|
|
- log.error("{}", e.getMessage());
|
|
|
+ log.error("call updateAfterMove failed: {}", e.getMessage());
|
|
|
// 4. 通知失败,转入本地补偿
|
|
|
compensator.recordFailure(uploadDoneResult);
|
|
|
}
|