Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
bwcx_jzy 2021-10-14 16:33:13 +08:00
commit 62291ed35b
2 changed files with 25 additions and 1 deletions

View File

@ -198,6 +198,29 @@ public class NodeUpdateHandler extends BaseProxyHandler {
}
WebSocketMessageModel restartMessage = new WebSocketMessageModel("restart", id);
client.send(restartMessage.toString());
// 重启后尝试访问插件端能够连接说明重启完毕
ThreadUtil.execute(() -> {
WebSocketMessageModel callbackRestartMessage = new WebSocketMessageModel("restart", id);
int retryCount = 0;
try {
// 先等待一会太快可能还没重启
Thread.sleep(10000L);
while (retryCount <= 30) {
++retryCount;
try {
Thread.sleep(1000L);
if (client.reconnectBlocking()) {
this.sendMsg(callbackRestartMessage.setData("重启完成"), session);
return;
}
} catch (Exception e) {}
}
this.sendMsg(callbackRestartMessage.setData("重连失败"), session);
} catch (Exception e) {
DefaultSystemLog.getLog().error("升级后重连插件端失败:" + model, e);
this.sendMsg(callbackRestartMessage.setData("重连插件端失败"), session);
}
});
} else {
this.sendMsg(model.setData("节点连接丢失"), session);
}

View File

@ -27,7 +27,7 @@
{{ text | version }}
</template>
<template slot="status" slot-scope="text">
<div class="restarting" v-if="text && text.type === 'restarting'">重启中大约需要30秒</div>
<div class="restarting" v-if="text && text.type === 'restarting'">{{ text.data }}</div>
<div class="uploading" v-if="text && text.type === 'uploading'">
<div class="text">{{ text.percent === 100 ? "上传成功" : "正在上传文件" }}</div>
<a-progress :percent="text.percent" />
@ -225,6 +225,7 @@ export default {
this.nodeStatus = Object.assign({}, this.nodeStatus, {
[nodeId]: {
type: "restarting",
data: data,
},
});
},