|
@@ -55,23 +55,13 @@ public class MDO0072Service extends MDO0072BaseModel implements ExecProcessFlow
|
|
|
private void run(SysFile file) throws Exception {
|
|
|
DockerExe.stopDocker(file.getId());
|
|
|
DockerExe.bdfToJson(file);
|
|
|
- final int[] con = {0};
|
|
|
final String[] line = {""};
|
|
|
CompletableFuture<Void> cf = CompletableFuture.supplyAsync(()-> {
|
|
|
try {
|
|
|
DockerExe.getDockerLogs(file.getId(),new ResultCallback.Adapter<Frame>() {
|
|
|
@Override
|
|
|
public void onNext(Frame frame) {
|
|
|
- if(con[0] <100){
|
|
|
- line[0]+=new String(frame.getPayload());
|
|
|
- con[0]++;
|
|
|
- }else{
|
|
|
- sendMsg(file.getId(), line[0]);
|
|
|
- line[0]="";
|
|
|
- con[0] =0;
|
|
|
- }
|
|
|
- sendMsg(file.getId(), line[0]);
|
|
|
- System.out.print(new String(frame.getPayload()));
|
|
|
+ line[0]+=new String(frame.getPayload());
|
|
|
super.onNext(frame);
|
|
|
}
|
|
|
|
|
@@ -84,6 +74,7 @@ public class MDO0072Service extends MDO0072BaseModel implements ExecProcessFlow
|
|
|
@Override
|
|
|
public void onComplete() {
|
|
|
System.out.println("日志获取完成");
|
|
|
+ sendMsg(file.getId(), line[0]);
|
|
|
super.onComplete();
|
|
|
}
|
|
|
});
|