优化图表大小及描述
This commit is contained in:
@@ -87,8 +87,8 @@ public class DockerUtil {
|
||||
String[] p = line.split("\\|");
|
||||
if (p.length < 2) continue;
|
||||
ContainerInfo info = new ContainerInfo();
|
||||
info.setContainerId(p.length > 0 ? p[0].trim() : "");
|
||||
info.setImage(p.length > 1 ? p[1].trim() : "");
|
||||
info.setContainerId(p[0].trim());
|
||||
info.setImage(p[1].trim());
|
||||
info.setCommand(p.length > 2 ? p[2].trim() : "");
|
||||
info.setCreated(p.length > 3 ? p[3].trim() : "");
|
||||
info.setStatus(p.length > 4 ? p[4].trim() : "");
|
||||
@@ -146,10 +146,6 @@ public class DockerUtil {
|
||||
}
|
||||
}
|
||||
|
||||
while (!channel.isClosed()) {
|
||||
Thread.sleep(50);
|
||||
}
|
||||
|
||||
String stdout = outBuilder.toString().trim();
|
||||
String stderr = errOut.toString(StandardCharsets.UTF_8).trim();
|
||||
int exitCode = channel.getExitStatus();
|
||||
@@ -165,9 +161,6 @@ public class DockerUtil {
|
||||
return DockerResult.fail("SSH 连接失败: " + e.getMessage());
|
||||
} catch (IOException e) {
|
||||
return DockerResult.fail("IO 异常: " + e.getMessage());
|
||||
} catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
return DockerResult.fail("执行被中断");
|
||||
} finally {
|
||||
if (channel != null && channel.isConnected()) channel.disconnect();
|
||||
if (session != null && session.isConnected()) session.disconnect();
|
||||
|
||||
Reference in New Issue
Block a user