|
@@ -79,7 +79,7 @@ public class StoreServiceImpl implements StoreService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public MediaProps getMediaInfo(String objectId, String sha256sum) {
|
|
|
|
|
|
|
+ public MediaProps getMediaInfo(String objectId, long size, String sha256sum) {
|
|
|
try {
|
|
try {
|
|
|
String ssdTempPath = diskService.getSsdTempPath(objectId);
|
|
String ssdTempPath = diskService.getSsdTempPath(objectId);
|
|
|
String hddTempPath = diskService.getHddTempPath(objectId);
|
|
String hddTempPath = diskService.getHddTempPath(objectId);
|
|
@@ -91,9 +91,9 @@ public class StoreServiceImpl implements StoreService {
|
|
|
File ssdTempFile = new File(ssdTempPath);
|
|
File ssdTempFile = new File(ssdTempPath);
|
|
|
|
|
|
|
|
File primaryFile;
|
|
File primaryFile;
|
|
|
- if (hddDataFile.exists()) {
|
|
|
|
|
|
|
+ if (hddDataFile.exists() && hddDataFile.length() == size) {
|
|
|
primaryFile = hddDataFile; // 大概率已经归档成功
|
|
primaryFile = hddDataFile; // 大概率已经归档成功
|
|
|
- } else if (hddTempFile.exists()) {
|
|
|
|
|
|
|
+ } else if (hddTempFile.exists() && hddTempFile.length() == size) {
|
|
|
primaryFile = hddTempFile; // 正在 HDD 临时区
|
|
primaryFile = hddTempFile; // 正在 HDD 临时区
|
|
|
} else {
|
|
} else {
|
|
|
primaryFile = ssdTempFile; // 刚上传完,还在 SSD
|
|
primaryFile = ssdTempFile; // 刚上传完,还在 SSD
|