@xuda.io/xuda-worker-bundle-min 1.3.514 → 1.3.516
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/index.js +9 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -873,6 +873,7 @@ var RUNTIME_SERVER_WEBSOCKET_CONNECTED = null;
|
|
|
873
873
|
var WEBSOCKET_PROCESS_PID = null;
|
|
874
874
|
|
|
875
875
|
glb.worker_queue_num = 0;
|
|
876
|
+
glb.websocket_queue_num = 0;
|
|
876
877
|
|
|
877
878
|
func.common.get_module = async function (SESSION_ID, module, paramsP = {}) {
|
|
878
879
|
let ret;
|
|
@@ -1120,9 +1121,11 @@ func.common.perform_rpi_request = async function (
|
|
|
1120
1121
|
}
|
|
1121
1122
|
};
|
|
1122
1123
|
const ws = async function () {
|
|
1124
|
+
glb.websocket_queue_num++;
|
|
1123
1125
|
RUNTIME_SERVER_WEBSOCKET.emit("message", {
|
|
1124
1126
|
service: serviceP,
|
|
1125
1127
|
data,
|
|
1128
|
+
websocket_queue_num: glb.websocket_queue_num,
|
|
1126
1129
|
});
|
|
1127
1130
|
throw new Error("fail to fetch from ws");
|
|
1128
1131
|
};
|
|
@@ -3460,7 +3463,12 @@ func.datasource.del = function (SESSION_ID, dsP) {
|
|
|
3460
3463
|
let _ds = SESSION_OBJ[SESSION_ID].DS_GLB[dsP];
|
|
3461
3464
|
if (_ds.worker_id) {
|
|
3462
3465
|
// if (_ds.data_xuda) console.log(dsP);
|
|
3463
|
-
if (
|
|
3466
|
+
if (
|
|
3467
|
+
RUNTIME_SERVER_WEBSOCKET &&
|
|
3468
|
+
RUNTIME_SERVER_WEBSOCKET_CONNECTED &&
|
|
3469
|
+
(!_session.opt.app_computing_mode ||
|
|
3470
|
+
_session.opt.app_computing_mode === "server")
|
|
3471
|
+
) {
|
|
3464
3472
|
WEB_WORKER[SESSION_ID][_ds.worker_id].emit("message", {
|
|
3465
3473
|
service: "close_websocket",
|
|
3466
3474
|
});
|