@clonegod/ttd-core 2.0.78 → 2.0.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ws/ws_client.d.ts +0 -1
- package/dist/ws/ws_client.js +1 -10
- package/package.json +1 -1
package/dist/ws/ws_client.d.ts
CHANGED
package/dist/ws/ws_client.js
CHANGED
|
@@ -23,7 +23,6 @@ class WebSocketClient {
|
|
|
23
23
|
this.keepAliveTimer = null;
|
|
24
24
|
this.url = url;
|
|
25
25
|
this.options = Object.assign({ reconnectInterval: 3000, rejectUnauthorized: false, keepAlive: false, keepAliveInterval: 30000 }, options);
|
|
26
|
-
this.setupGlobalErrorHandlers();
|
|
27
26
|
(0, dist_1.log_info)(`WebSocketClient constructor, url: ${this.url}`, this.options);
|
|
28
27
|
}
|
|
29
28
|
connect() {
|
|
@@ -62,7 +61,7 @@ class WebSocketClient {
|
|
|
62
61
|
}
|
|
63
62
|
reconnect() {
|
|
64
63
|
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
-
(0, dist_1.
|
|
64
|
+
(0, dist_1.log_info)(`Reconnecting in ${this.options.reconnectInterval}ms`);
|
|
66
65
|
yield (0, dist_1.sleep)(this.options.reconnectInterval);
|
|
67
66
|
this.disconnect();
|
|
68
67
|
this.connect();
|
|
@@ -123,13 +122,5 @@ class WebSocketClient {
|
|
|
123
122
|
(0, dist_1.log_info)('KeepAlive stopped');
|
|
124
123
|
}
|
|
125
124
|
}
|
|
126
|
-
setupGlobalErrorHandlers() {
|
|
127
|
-
process.on('uncaughtException', (error) => {
|
|
128
|
-
(0, dist_1.log_error)('Uncaught Exception in WebSocketClient:', error);
|
|
129
|
-
});
|
|
130
|
-
process.on('unhandledRejection', (reason, promise) => {
|
|
131
|
-
(0, dist_1.log_error)('Unhandled Rejection in WebSocketClient:', reason instanceof Error ? reason : new Error(String(reason)));
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
125
|
}
|
|
135
126
|
exports.WebSocketClient = WebSocketClient;
|