|
@@ -46,32 +46,37 @@ public class ComponentCreateImgBizImpl {
|
|
|
while (flag) {
|
|
|
Thread.sleep(3000);
|
|
|
ComponentCreateImgBizImpl.log.warn("查询" + session.id() + "|----------" + id);
|
|
|
- if (StrUtil.equals(status, "query")) {
|
|
|
- if (redisUtil.hasKey("componentCreateImgStatus:id:" + id)) {
|
|
|
- String ObjStatus = redisUtil.get("componentCreateImgStatus:id:" + id);
|
|
|
- if (StrUtil.equals(ObjStatus, "done") || StrUtil.equals(ObjStatus, "error")) {
|
|
|
- waitForResult(new ParamContext("msg", extracted(id, ObjStatus, action)), callId);
|
|
|
- flag = false;
|
|
|
- }
|
|
|
- } else {
|
|
|
- ComponentModelUploadEntity entity = componentModelUploadService.findById(id);
|
|
|
- Thread.sleep(2000);
|
|
|
- if (ObjectUtil.isNotNull(entity)) {
|
|
|
- if (entity.getStatus() == 1 && entity.getProgress() == 100) {
|
|
|
- redisUtil.setEx("componentCreateImgStatus:id:" + id, "done", 5, TimeUnit.MINUTES);
|
|
|
- waitForResult(new ParamContext("msg", extracted(id, "done", action)), callId);
|
|
|
+ if (session.isOpen()) {
|
|
|
+ if (StrUtil.equals(status, "query")) {
|
|
|
+ if (redisUtil.hasKey("componentCreateImgStatus:id:" + id)) {
|
|
|
+ String ObjStatus = redisUtil.get("componentCreateImgStatus:id:" + id);
|
|
|
+ if (StrUtil.equals(ObjStatus, "done") || StrUtil.equals(ObjStatus, "error")) {
|
|
|
+ waitForResult(new ParamContext("msg", extracted(id, ObjStatus, action)), callId);
|
|
|
flag = false;
|
|
|
- } else if (entity.getStatus() == -1) {
|
|
|
- redisUtil.delete("modelUploadStatus:id:" + id);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ ComponentModelUploadEntity entity = componentModelUploadService.findById(id);
|
|
|
+ Thread.sleep(2000);
|
|
|
+ if (ObjectUtil.isNotNull(entity)) {
|
|
|
+ if (entity.getStatus() == 1 && entity.getProgress() == 100) {
|
|
|
+ redisUtil.setEx("componentCreateImgStatus:id:" + id, "done", 5, TimeUnit.MINUTES);
|
|
|
+ waitForResult(new ParamContext("msg", extracted(id, "done", action)), callId);
|
|
|
+ flag = false;
|
|
|
+ } else if (entity.getStatus() == -1) {
|
|
|
+ redisUtil.delete("modelUploadStatus:id:" + id);
|
|
|
+ waitForResult(new ParamContext("msg", extracted(id, "error", action)), callId);
|
|
|
+ flag = false;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ //查不到直接返回错误
|
|
|
waitForResult(new ParamContext("msg", extracted(id, "error", action)), callId);
|
|
|
flag = false;
|
|
|
}
|
|
|
- } else {
|
|
|
- //查不到直接返回错误
|
|
|
- waitForResult(new ParamContext("msg", extracted(id, "error", action)), callId);
|
|
|
- flag = false;
|
|
|
}
|
|
|
}
|
|
|
+ } else {
|
|
|
+ ComponentCreateImgBizImpl.log.info("连接关闭" + session.id());
|
|
|
+ flag = false;
|
|
|
}
|
|
|
}
|
|
|
}
|