This commit is contained in:
Xu Chang 2024-09-14 10:29:50 +08:00
commit f39737d191
4 changed files with 21 additions and 22 deletions

View File

@ -107,14 +107,15 @@ export class SubScriber extends Feature {
let count = 0;
socket.on('connect_error', async () => {
count++;
if (count > 10) {
if (count > 50) {
// 可能socket地址改变了刷新重连
socket.removeAllListeners();
socket.disconnect();
this.url = undefined;
await this.connect();
resolve(undefined);
}
socket.removeAllListeners();
socket.disconnect();
this.socket = null;
await this.connect();
resolve(undefined);
});
}
socket.connect();

View File

@ -111,14 +111,15 @@ class SubScriber extends Feature_1.Feature {
let count = 0;
socket.on('connect_error', async () => {
count++;
if (count > 10) {
if (count > 50) {
// 可能socket地址改变了刷新重连
socket.removeAllListeners();
socket.disconnect();
this.url = undefined;
await this.connect();
resolve(undefined);
}
socket.removeAllListeners();
socket.disconnect();
this.socket = null;
await this.connect();
resolve(undefined);
});
}
socket.connect();

View File

@ -1,6 +1,6 @@
{
"name": "oak-frontend-base",
"version": "5.3.4",
"version": "5.3.5",
"description": "oak框架中前端与业务逻辑无关的平台部分",
"author": {
"name": "XuChang"
@ -23,12 +23,8 @@
"keepalive-for-react": "^2.0.7",
"node-schedule": "^2.1.1",
"nprogress": "^0.2.0",
<<<<<<< HEAD
"oak-common-aspect": "~3.0.1",
=======
"oak-common-aspect": "~3.0.0",
>>>>>>> dev
"oak-domain": "~5.0.19",
"oak-domain": "~5.0.20",
"oak-memory-tree-store": "~3.3.1",
"ol": "^7.3.0",
"react-activation": "^0.12.4",

View File

@ -148,16 +148,17 @@ export class SubScriber<ED extends EntityDict & BaseEntityDict> extends Feature
if (!optionInited) {
let count = 0;
socket.on('connect_error', async () => {
socket.on('connect_error', async (err) => {
count++;
if (count > 10) {
if (count > 50) {
// 可能socket地址改变了刷新重连
socket.removeAllListeners();
socket.disconnect();
this.url = undefined;
await this.connect();
resolve(undefined);
}
socket.removeAllListeners();
socket.disconnect();
this.url = undefined;
await this.connect();
resolve(undefined);
});
}