文件备份的bug
This commit is contained in:
parent
7139f5350c
commit
1aae819f4e
|
|
@ -136,7 +136,7 @@ public class FileRecycleServiceImpl implements FileRecycleService {
|
|||
.eq(EdFileInfo::getFileId, fileId));
|
||||
for (EdFileInfo edFileInfo : edFileInfos) {
|
||||
String fileSysPath = commonService.getFileSysPath(edFileInfo.getId());
|
||||
backupHandler.backupFiles(fileSysPath, edFileInfo.getParentId());
|
||||
backupHandler.backupFiles(fileSysPath);
|
||||
String fileDbPath = commonService.getDbPath(edFileInfo.getFilePath());
|
||||
// 移动到tmp目录,七天后删除
|
||||
fileSystemService.moveFile(fileSysPath, elePropertyConfig.getEleTmpPath() + File.separator + new File(fileSysPath).getName());
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ public class BackupHandler {
|
|||
@Resource
|
||||
private ElePropertyConfig elePropertyConfig;
|
||||
|
||||
public BackupFileResLog backupFiles(String filePath, String id) {
|
||||
public BackupFileResLog backupFiles(String filePath) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("file", new File(filePath));
|
||||
String url = StrFormatter.format("http://{}:{}/data/file/backup/upload", elePropertyConfig.getRemoteHost(), elePropertyConfig.getRemotePort());
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ public class BackupTask {
|
|||
.eq(EdFileInfo::getId, id));
|
||||
String sysFilePath = commonService.getFileSysPath(fileInfo.getId());
|
||||
long startTime = System.currentTimeMillis();
|
||||
BackupFileResLog resLog = backupHandler.backupFiles(sysFilePath, id);
|
||||
BackupFileResLog resLog = backupHandler.backupFiles(sysFilePath);
|
||||
long endTime = System.currentTimeMillis();
|
||||
fileBackupLogMapper.update(null, Wrappers.<FileBackupLog>lambdaUpdate()
|
||||
.eq(FileBackupLog::getFileId, id)
|
||||
|
|
@ -100,7 +100,7 @@ public class BackupTask {
|
|||
String fileSysPath = commonService.getFileSysPath(edFileInfo.getId());
|
||||
UserThreadLocal.remove();
|
||||
long startTime = System.currentTimeMillis();
|
||||
BackupFileResLog resLog = backupHandler.backupFiles(fileSysPath, edFileInfo.getId());
|
||||
BackupFileResLog resLog = backupHandler.backupFiles(fileSysPath);
|
||||
long endTime = System.currentTimeMillis();
|
||||
FileBackupLog backupLog = new FileBackupLog()
|
||||
.setId(IdWorker.getSnowFlakeIdString())
|
||||
|
|
|
|||
Loading…
Reference in New Issue