@xuda.io/xuda-worker-bundle-min 1.3.1173 → 1.3.1175
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 +49 -50
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -2202,17 +2202,13 @@ func.datasource.execute = async function (
|
|
|
2202
2202
|
typeof IS_PROCESS_SERVER === "undefined" && _ds.viewSourceProp === "globals") {
|
|
2203
2203
|
|
|
2204
2204
|
if (!["main"].includes(_session.opt.app_computing_mode)) {
|
|
2205
|
-
|
|
2206
2205
|
await func.index.call_worker(SESSION_ID, {
|
|
2207
2206
|
service: "create_webworker_globals",
|
|
2208
2207
|
data: { ds_data: _ds, session_id: SESSION_ID },
|
|
2209
2208
|
});
|
|
2210
2209
|
}
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
2210
|
}
|
|
2214
2211
|
|
|
2215
|
-
|
|
2216
2212
|
if (
|
|
2217
2213
|
await func.datasource.get_view_events_count(
|
|
2218
2214
|
SESSION_ID,
|
|
@@ -3221,60 +3217,63 @@ func.datasource.run_events_functions = async function (
|
|
|
3221
3217
|
calling_job,
|
|
3222
3218
|
NA_calling_job_ds
|
|
3223
3219
|
) {
|
|
3224
|
-
return new Promise(async (resolve, reject) => {
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3220
|
+
// return new Promise(async (resolve, reject) => {
|
|
3221
|
+
var _ds = SESSION_OBJ[SESSION_ID].DS_GLB[dataSourceSession];
|
|
3222
|
+
var args = _ds.args;
|
|
3223
|
+
// var v = _ds.v;
|
|
3224
|
+
const _view_obj = await func.utils.VIEWS_OBJ.get(SESSION_ID, _ds.prog_id);
|
|
3225
|
+
// let job_promises = []
|
|
3226
|
+
if (_view_obj.progEvents) {
|
|
3227
|
+
for await (const [key, val] of Object.entries(_view_obj.progEvents)) {
|
|
3228
|
+
if (
|
|
3229
|
+
val.data.type === "user_defined" &&
|
|
3230
|
+
val.data.event_name &&
|
|
3231
|
+
val.data.event_name === event_id
|
|
3232
|
+
) {
|
|
3233
|
+
const jobs = await func.events.validate(
|
|
3234
|
+
SESSION_ID,
|
|
3235
|
+
"user_defined",
|
|
3236
|
+
dataSourceSession,
|
|
3237
|
+
val.data.event_name,
|
|
3238
|
+
args.callingSourceP,
|
|
3239
|
+
val.data.parameters
|
|
3240
|
+
);
|
|
3241
|
+
|
|
3242
|
+
if (!calling_job) continue
|
|
3243
|
+
|
|
3244
|
+
for (job_num of jobs) {
|
|
3245
|
+
job_promises.push(new Promise((resolve, reject) => {
|
|
3246
|
+
const interval = setInterval(() => {
|
|
3247
|
+
var job_index = func.events.find_job_index(SESSION_ID, job_num);
|
|
3248
|
+
if (job_index == null) {
|
|
3249
|
+
clearInterval(interval)
|
|
3250
|
+
resolve(job_num);
|
|
3251
|
+
}
|
|
3252
|
+
}, 100);
|
|
3253
|
+
}))
|
|
3256
3254
|
}
|
|
3257
3255
|
}
|
|
3256
|
+
}
|
|
3258
3257
|
|
|
3259
3258
|
|
|
3260
3259
|
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3260
|
+
}
|
|
3261
|
+
if (job_promises.length) {
|
|
3262
|
+
await Promise.all(job_promises)
|
|
3263
|
+
}
|
|
3264
|
+
// resolve()
|
|
3266
3265
|
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3266
|
+
// if (job_promises.length) {
|
|
3267
|
+
// Promise.all(job_promises)
|
|
3268
|
+
// .then((e) => {
|
|
3269
|
+
// resolve()
|
|
3270
|
+
// });
|
|
3272
3271
|
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3272
|
+
// } else {
|
|
3273
|
+
// resolve()
|
|
3274
|
+
// }
|
|
3276
3275
|
|
|
3277
|
-
})
|
|
3276
|
+
// })
|
|
3278
3277
|
|
|
3279
3278
|
};
|
|
3280
3279
|
|