dolphindb 3.0.29 → 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 +34 -8
- package/browser.js.map +1 -1
- package/i18n/dict.json +3 -0
- package/index.js +34 -8
- package/index.js.map +1 -1
- package/package.json +2 -2
- package/test.js +12 -14
- 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) {
|
|
@@ -3081,13 +3098,22 @@ export class DDB {
|
|
|
3081
3098
|
first = false;
|
|
3082
3099
|
}
|
|
3083
3100
|
else {
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
}
|
|
3101
|
+
let rows;
|
|
3102
|
+
// 用了流数据过滤功能后,必然发 table
|
|
3103
|
+
if (obj.form === DdbForm.table) {
|
|
3104
|
+
data = obj.data();
|
|
3105
|
+
data.name ||= schema.name;
|
|
3106
|
+
rows = data.data.length;
|
|
3107
|
+
}
|
|
3108
|
+
else {
|
|
3109
|
+
const _data = obj.data();
|
|
3110
|
+
const { columns } = schema;
|
|
3111
|
+
rows = _data[0]?.length || 0;
|
|
3112
|
+
data = {
|
|
3113
|
+
...schema,
|
|
3114
|
+
data: seq(rows, i => zip_object(columns, seq(columns.length, j => _data[j][i])))
|
|
3115
|
+
};
|
|
3116
|
+
}
|
|
3091
3117
|
win.rows += rows;
|
|
3092
3118
|
win.segments.push(data);
|
|
3093
3119
|
win.objs.push(obj);
|