dolphindb 3.0.30 → 3.0.31
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/browser.js +18 -1
- package/browser.js.map +1 -1
- package/i18n/dict.json +3 -0
- package/index.js +18 -1
- package/index.js.map +1 -1
- package/package.json +2 -2
- package/test.js +3 -2
- package/test.js.map +1 -1
package/i18n/dict.json
CHANGED
package/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import DayjsCustomParseFormat from 'dayjs/plugin/customParseFormat.js';
|
|
|
3
3
|
dayjs.extend(DayjsCustomParseFormat);
|
|
4
4
|
import ipaddrjs from 'ipaddr.js';
|
|
5
5
|
const { fromByteArray: buf2ipaddr } = ipaddrjs;
|
|
6
|
-
import { concat, assert, inspect, typed_array_to_buffer, connect_websocket, Lock, genid, seq, zip_object, WebSocketOpen, WebSocketClosed, WebSocketClosing, decode, } from 'xshell';
|
|
6
|
+
import { concat, assert, inspect, typed_array_to_buffer, connect_websocket, Lock, genid, seq, zip_object, WebSocketOpen, WebSocketClosed, WebSocketClosing, decode, delay } from 'xshell';
|
|
7
7
|
import { t } from './i18n/index.js';
|
|
8
8
|
export const nulls = {
|
|
9
9
|
int8: -0x80, // -128
|
|
@@ -2628,6 +2628,23 @@ export class DDB {
|
|
|
2628
2628
|
await this.rpc('connect', { skip_connection_check: true });
|
|
2629
2629
|
if (this.streaming)
|
|
2630
2630
|
await this.subscribe();
|
|
2631
|
+
else
|
|
2632
|
+
// 定时执行一次空脚本作为心跳检查,避免因为 nat 超时导致 tcp 连接断开
|
|
2633
|
+
(async () => {
|
|
2634
|
+
while (true) {
|
|
2635
|
+
await delay(1000 * 60 * 4.5);
|
|
2636
|
+
if (this.connected)
|
|
2637
|
+
try {
|
|
2638
|
+
await this.eval('');
|
|
2639
|
+
}
|
|
2640
|
+
catch (error) {
|
|
2641
|
+
console.log(t('{{time}} 心跳检测失败,连接已断开', { time: new Date().to_formal_str() }), error);
|
|
2642
|
+
break;
|
|
2643
|
+
}
|
|
2644
|
+
else
|
|
2645
|
+
break;
|
|
2646
|
+
}
|
|
2647
|
+
})();
|
|
2631
2648
|
resolve();
|
|
2632
2649
|
}
|
|
2633
2650
|
catch (error) {
|