@xuda.io/xuda-worker-bundle-min 1.3.2392 → 1.3.2394
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 +35 -36
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -3934,44 +3934,43 @@ func.datasource.interval = function (session_id, dsSessionP, typeP) {
|
|
|
3934
3934
|
};
|
|
3935
3935
|
return fx;
|
|
3936
3936
|
};
|
|
3937
|
-
func.datasource.server_cron = function (session_id) {
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
// var ds = SESSION_OBJ[SESSION_ID].DS_GLB[0];
|
|
3941
|
-
// var v = ds.v;
|
|
3942
|
-
var arr = func.datasource.get_event_interval_arr(SESSION_ID, 0, 'server_cron');
|
|
3943
|
-
const schedule = require('node-schedule');
|
|
3937
|
+
// func.datasource.server_cron = function (session_id) {
|
|
3938
|
+
// var SESSION_ID = session_id;
|
|
3939
|
+
// var jobs = [];
|
|
3944
3940
|
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
}
|
|
3948
|
-
for (let val of arr) {
|
|
3949
|
-
var event_id = val[0];
|
|
3950
|
-
var cron_prop = val[1];
|
|
3951
|
-
var condition = val[2];
|
|
3952
|
-
|
|
3953
|
-
jobs.push(
|
|
3954
|
-
schedule.scheduleJob(cron_prop, async function () {
|
|
3955
|
-
if (!SESSION_OBJ[SESSION_ID]) return;
|
|
3956
|
-
var event_count = await func.datasource.get_view_events_count(SESSION_ID, 0, 'server_cron', event_id);
|
|
3957
|
-
if (!event_count) {
|
|
3958
|
-
fx.clear();
|
|
3959
|
-
return;
|
|
3960
|
-
}
|
|
3961
|
-
var event_condition = await func.expression.get(SESSION_ID, condition, 0, 'condition'); // execute condition;
|
|
3962
|
-
if (condition && !event_condition.result) return;
|
|
3963
|
-
if (event_count) {
|
|
3964
|
-
const e = await func.datasource.execute_view_events(SESSION_ID, 0, 'server_cron', event_id);
|
|
3965
|
-
// for (const [key, val] of Object.entries(e)) {
|
|
3966
|
-
// val.done = false;
|
|
3967
|
-
// }
|
|
3968
|
-
}
|
|
3969
|
-
}),
|
|
3970
|
-
);
|
|
3971
|
-
}
|
|
3941
|
+
// var arr = func.datasource.get_event_interval_arr(SESSION_ID, 0, 'server_cron');
|
|
3942
|
+
// const schedule = require('node-schedule');
|
|
3972
3943
|
|
|
3973
|
-
|
|
3974
|
-
|
|
3944
|
+
// if (!arr.length) {
|
|
3945
|
+
// return jobs;
|
|
3946
|
+
// }
|
|
3947
|
+
// for (let val of arr) {
|
|
3948
|
+
// var event_id = val[0];
|
|
3949
|
+
// var cron_prop = val[1];
|
|
3950
|
+
// var condition = val[2];
|
|
3951
|
+
|
|
3952
|
+
// jobs.push(
|
|
3953
|
+
// schedule.scheduleJob(cron_prop, async function () {
|
|
3954
|
+
// if (!SESSION_OBJ[SESSION_ID]) return;
|
|
3955
|
+
// var event_count = await func.datasource.get_view_events_count(SESSION_ID, 0, 'server_cron', event_id);
|
|
3956
|
+
// if (!event_count) {
|
|
3957
|
+
// fx.clear();
|
|
3958
|
+
// return;
|
|
3959
|
+
// }
|
|
3960
|
+
// var event_condition = await func.expression.get(SESSION_ID, condition, 0, 'condition'); // execute condition;
|
|
3961
|
+
// if (condition && !event_condition.result) return;
|
|
3962
|
+
// if (event_count) {
|
|
3963
|
+
// const e = await func.datasource.execute_view_events(SESSION_ID, 0, 'server_cron', event_id);
|
|
3964
|
+
// // for (const [key, val] of Object.entries(e)) {
|
|
3965
|
+
// // val.done = false;
|
|
3966
|
+
// // }
|
|
3967
|
+
// }
|
|
3968
|
+
// }),
|
|
3969
|
+
// );
|
|
3970
|
+
// }
|
|
3971
|
+
|
|
3972
|
+
// return jobs;
|
|
3973
|
+
// };
|
|
3975
3974
|
func.datasource.get_viewLoops = async function (SESSION_ID, dataSourceSession, data, batch_source, default_limit) {
|
|
3976
3975
|
var _ds = SESSION_OBJ[SESSION_ID].DS_GLB[dataSourceSession];
|
|
3977
3976
|
var args = _ds.args;
|