下载优化
This commit is contained in:
@@ -89,7 +89,7 @@ public class AskDeviceDataServiceImpl implements AskDeviceDataService {
|
||||
|
||||
@Override
|
||||
public boolean downloadFile(String nDid, String name, Integer size, String fileCheck) {
|
||||
boolean result = true;
|
||||
boolean result = false;
|
||||
try {
|
||||
redisUtil.saveByKeyWithExpire("fileDowning:"+nDid,"fileDowning",300L);
|
||||
redisUtil.saveByKeyWithExpire("fileCheck"+name,fileCheck,300L);
|
||||
@@ -104,9 +104,8 @@ public class AskDeviceDataServiceImpl implements AskDeviceDataService {
|
||||
Thread.sleep(2000);
|
||||
Object object2 = redisUtil.getObjectByKey("downloadFilePath:"+name);
|
||||
if (!Objects.isNull(object2)) {
|
||||
result = true;
|
||||
break;
|
||||
} else {
|
||||
result = false;
|
||||
}
|
||||
}
|
||||
mid = mid + 1;
|
||||
|
||||
@@ -152,7 +152,7 @@ public class FileServiceImpl implements IFileService {
|
||||
redisUtil.delete(AppRedisKey.RMQ_FILE_CONSUME_KEY.concat(fileName));
|
||||
} else {
|
||||
//收到数据就刷新缓存值
|
||||
redisUtil.saveByKeyWithExpire(AppRedisKey.FILE_DOWN_TIME.concat(appFileMessage.getMsg().getName()), null, 10L);
|
||||
redisUtil.saveByKeyWithExpire(AppRedisKey.FILE_DOWN_TIME.concat(appFileMessage.getMsg().getName()), null, 60L);
|
||||
Object object1 = redisUtil.getObjectByKey(AppRedisKey.FILE_PART.concat(fileName));
|
||||
if (Objects.isNull(object1)){
|
||||
fileStreamDto.setTotal(appFileMessage.getMsg().getFrameTotal());
|
||||
@@ -193,6 +193,7 @@ public class FileServiceImpl implements IFileService {
|
||||
redisUtil.delete(AppRedisKey.FILE_PART_TIME.concat(appFileMessage.getMsg().getName()));
|
||||
redisUtil.delete(AppRedisKey.FILE_PART.concat(appFileMessage.getMsg().getName()));
|
||||
redisUtil.delete(AppRedisKey.RMQ_FILE_CONSUME_KEY.concat(fileName));
|
||||
redisUtil.delete(AppRedisKey.FILE_DOWN_TIME.concat(appFileMessage.getMsg().getName()));
|
||||
} else {
|
||||
csEventLogs.setStatus(1);
|
||||
csEventLogs.setRemark("当前文件" + appFileMessage.getMsg().getFrameTotal() + "帧,这是第" + appFileMessage.getMsg().getFrameCurr() + "帧,记录成功!");
|
||||
@@ -244,7 +245,7 @@ public class FileServiceImpl implements IFileService {
|
||||
removeInfoUtils.deleteEventInfo(appFileMessage.getId(),fileName);
|
||||
} else {
|
||||
//收到数据就刷新缓存值
|
||||
redisUtil.saveByKeyWithExpire(AppRedisKey.FILE_PART_TIME.concat(appFileMessage.getMsg().getName()), null, 10L);
|
||||
redisUtil.saveByKeyWithExpire(AppRedisKey.FILE_PART_TIME.concat(appFileMessage.getMsg().getName()), null, 60L);
|
||||
Object object1 = redisUtil.getObjectByKey(AppRedisKey.FILE_PART.concat(fileName));
|
||||
if (Objects.isNull(object1)){
|
||||
fileStreamDto.setTotal(appFileMessage.getMsg().getFrameTotal());
|
||||
|
||||
Reference in New Issue
Block a user