上传平台修复bug最终版3

master
土豆兄弟 4 years ago
parent 1f869da9bd
commit 5304070b75

@ -47,6 +47,7 @@ import java.util.stream.Collectors;
import static me.zhengjie.modules.common.consts.SendBigDataConst.NON_FINISH_SEND_STATATUS; import static me.zhengjie.modules.common.consts.SendBigDataConst.NON_FINISH_SEND_STATATUS;
import static me.zhengjie.modules.remoterec.consts.RemoteRecConst.SUCCESS_TAG; import static me.zhengjie.modules.remoterec.consts.RemoteRecConst.SUCCESS_TAG;
import static me.zhengjie.modules.remoterec.consts.RemoteRecConst.WAIT_SUCCESS_TAG;
@Component @Component
@Scope("prototype") @Scope("prototype")
@ -126,6 +127,7 @@ public class SendBigDataTask {
if (remoteRecord.getId() != null){ if (remoteRecord.getId() != null){
RemoteRecordDto remoteRecordDto = remoteRecordService.findById(remoteRecord.getId()); RemoteRecordDto remoteRecordDto = remoteRecordService.findById(remoteRecord.getId());
waitSendSuccessRemoteRec(remoteRecordDto);
// 远程文件存储形式的源 // 远程文件存储形式的源
remoteCollect = getRemoteRecFromLocal(remoteRecordDto); remoteCollect = getRemoteRecFromLocal(remoteRecordDto);
// 进行去重逻辑 // 进行去重逻辑
@ -139,6 +141,15 @@ public class SendBigDataTask {
// Collections.shuffle(collect); // Collections.shuffle(collect);
} }
private void waitSendSuccessRemoteRec(RemoteRecordDto remoteRecordDto) {
// 对发送后的状态进行更新
RemoteRecord remote = new RemoteRecord();
BeanUtil.copyProperties(remoteRecordDto, remote);
remote.setTag(WAIT_SUCCESS_TAG);
remote.setWeight(5); // 把正在发送权重改成 5
remoteRecordService.update(remote);
}
private void finishSendThenUpdateRec(BuildRecord resource, BuildRecordDto buildRecordDto, AtomicLong atomicLong) { private void finishSendThenUpdateRec(BuildRecord resource, BuildRecordDto buildRecordDto, AtomicLong atomicLong) {
// 对发送后的状态进行更新 // 对发送后的状态进行更新
buildRecordDto.setIsSend(FINISH_SEND_TAG); buildRecordDto.setIsSend(FINISH_SEND_TAG);

@ -2,6 +2,10 @@ package me.zhengjie.modules.remoterec.consts;
public class RemoteRecConst { public class RemoteRecConst {
/**
*
*/
public static final Integer WAIT_SUCCESS_TAG = 3;
/** /**
* *

@ -6,7 +6,7 @@ package me.zhengjie.modules.remoterec.consts;
public class SysConst { public class SysConst {
// 远程服务器的相关配置 // 远程服务器的相关配置
public static final String REMOTE_TRANS_HOST = "118.178.137.129"; public static final String REMOTE_TRANS_HOST = "116.62.197.152";
public static final Integer REMOTE_TRANS_PORT = 22; public static final Integer REMOTE_TRANS_PORT = 22;

@ -5,7 +5,7 @@ spring:
freemarker: freemarker:
check-template-location: false check-template-location: false
profiles: profiles:
active: prod active: test
jackson: jackson:
time-zone: GMT+8 time-zone: GMT+8
data: data:

Loading…
Cancel
Save