@xuda.io/xuda-worker-bundle-min 1.3.206 → 1.3.207
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 +8 -10
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -312,16 +312,17 @@ func.common.db = async function (
|
|
|
312
312
|
const perform_rpi_request_from_studio = async function (serviceP) {
|
|
313
313
|
return new Promise(function (resolve, reject) {
|
|
314
314
|
var _session = SESSION_OBJ[SESSION_ID];
|
|
315
|
+
const req_id = crypto.randomUUID();
|
|
315
316
|
if (glb.IS_WORKER) {
|
|
316
317
|
func.utils.post_back_to_client(
|
|
317
318
|
SESSION_ID,
|
|
318
319
|
"perform_rpi_request_from_studio",
|
|
319
320
|
_session.worker_id,
|
|
320
|
-
{ service: serviceP, data: dataP }
|
|
321
|
+
{ service: serviceP, data: dataP, req_id }
|
|
321
322
|
);
|
|
322
323
|
|
|
323
324
|
self.addEventListener(
|
|
324
|
-
"rpi_request_response_worker_" +
|
|
325
|
+
"rpi_request_response_worker_" + req_id,
|
|
325
326
|
(event) => {
|
|
326
327
|
// console.log("Custom event triggered:", event);
|
|
327
328
|
resolve(event.detail.data);
|
|
@@ -330,21 +331,18 @@ func.common.db = async function (
|
|
|
330
331
|
} else {
|
|
331
332
|
STUDIO_PEER_CONN.send({
|
|
332
333
|
service: "perform_rpi_request",
|
|
333
|
-
// data: { ...dataP, ...{ dbs_method: serviceP } },
|
|
334
334
|
data: dataP,
|
|
335
335
|
dbs_method: serviceP,
|
|
336
336
|
id: STUDIO_PEER.id,
|
|
337
337
|
source: "runtime",
|
|
338
338
|
app_id,
|
|
339
|
+
req_id,
|
|
339
340
|
});
|
|
340
341
|
|
|
341
|
-
$("body").on(
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
$("body").off("rpi_request_response_" + dataP.table_id);
|
|
346
|
-
}
|
|
347
|
-
);
|
|
342
|
+
$("body").on("rpi_request_response_" + req_id, function (e, data) {
|
|
343
|
+
resolve(data.data);
|
|
344
|
+
$("body").off("rpi_request_response_" + req_id);
|
|
345
|
+
});
|
|
348
346
|
}
|
|
349
347
|
});
|
|
350
348
|
};
|