Commit 503961b2 authored by linpeiqin's avatar linpeiqin

在websocket里面请求导致token无法获取http上下文

parent cc1e8503
......@@ -36,6 +36,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.io.File;
import java.net.URI;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
/**
* 精调任务运行数据操作服务类。
......@@ -61,6 +62,8 @@ public class TuningRunServiceImpl extends BaseService<TuningRun, Long> implement
@Autowired
private PythonConfig pythonConfig;
private AtomicInteger isSuccess;
/**
* 返回当前Service的主表Mapper对象。
......@@ -241,10 +244,7 @@ public class TuningRunServiceImpl extends BaseService<TuningRun, Long> implement
if (receiveMsg.equals("process_completed")) {
this.close();
if (receiveJson.getBoolean("success")){
saveAll(tuningRun,targetModelVersionURl,runPublishDto);
tuningRun.setPublishStatus(1);
} else {
tuningRun.setPublishStatus(-1);
isSuccess.set(1);
}
}
}
......@@ -257,6 +257,13 @@ public class TuningRunServiceImpl extends BaseService<TuningRun, Long> implement
log.error("报错了:::" + e.getMessage());
}
}.connect();
System.out.println("isSuccess.get():" + isSuccess.get());
if (isSuccess.get() == 1) {
saveAll(tuningRun,targetModelVersionURl,runPublishDto);
tuningRun.setPublishStatus(1);
} else {
tuningRun.setPublishStatus(-1);
}
return this.updateById(tuningRun);
}
@Transactional(rollbackFor = Exception.class)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment