@xuda.io/runtime-bundle 1.0.508 → 1.0.510

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.
@@ -1677,7 +1677,7 @@ func.datasource.create = async function (
1677
1677
  if (_session.DS_GLB[parentDataSourceNoP]._run_at) run_at = _session.DS_GLB[parentDataSourceNoP].v.run_at;
1678
1678
  }
1679
1679
 
1680
- const done = function (SESSION_ID, dsSessionP, is_serverP) {
1680
+ const done = function (SESSION_ID, dsSessionP, response_returned_from_worker) {
1681
1681
  var _ds = SESSION_OBJ[SESSION_ID].DS_GLB[dsSessionP];
1682
1682
 
1683
1683
  if (IS_DATASOURCE_REFRESH) {
@@ -1715,7 +1715,8 @@ func.datasource.create = async function (
1715
1715
 
1716
1716
  let interval = setInterval(() => {
1717
1717
  let idle_count = 0;
1718
- for (const _ds of ds_connected) {
1718
+ for (const dsSession of ds_connected) {
1719
+ const _ds = _session.DS_GLB[dsSession];
1719
1720
  if (_ds.stat == 'idle') {
1720
1721
  idle_count++;
1721
1722
  }
@@ -1727,7 +1728,6 @@ func.datasource.create = async function (
1727
1728
  }, 1000);
1728
1729
  };
1729
1730
 
1730
- // _ds.stat = "idle";
1731
1731
  set_stat_idle();
1732
1732
  resolve({
1733
1733
  SESSION_ID,
@@ -1768,7 +1768,7 @@ func.datasource.create = async function (
1768
1768
  );
1769
1769
  return done(SESSION_ID, ret.dsSessionP);
1770
1770
  }
1771
-
1771
+ // vvvv run at worker vvvv
1772
1772
  if (_ds) IS_DATASOURCE_REFRESH = true;
1773
1773
  var data = _.assignIn(
1774
1774
  {
@@ -5173,8 +5173,8 @@ func.utils.ws_worker.functions = {
5173
5173
  args.run_atP,
5174
5174
  args.worker_id,
5175
5175
  );
5176
-
5177
- if (show_log) console.log('DATASOURCE EXECUTION DONE ' + ret.dsSessionP + ' ' + _session.DS_GLB[ret.dsSessionP]?.tree_obj?.menuName || '' + ' SESSION_ID: ' + SESSION_ID, APP_OBJ[_session.app_id].app_name);
5176
+ let _ds = _session.DS_GLB[ret.dsSessionP];
5177
+ if (show_log) console.log('DATASOURCE EXECUTION DONE ' + ret.dsSessionP + ' ' + _ds?.tree_obj?.menuName || '' + ' SESSION_ID: ' + SESSION_ID, APP_OBJ[_session.app_id].app_name);
5178
5178
  var obj = func.utils.clean_returned_datasource(SESSION_ID, ret?.dsSessionP);
5179
5179
  obj.dataSourceSessionGlobal = _session.dataSourceSessionGlobal;
5180
5180
 
@@ -5186,6 +5186,7 @@ func.utils.ws_worker.functions = {
5186
5186
  process_pid: params.process_pid,
5187
5187
  service: params.service,
5188
5188
  });
5189
+ _ds.stat = 'idle';
5189
5190
  },
5190
5191
  datasource_delete: function (params, promise_queue_id) {
5191
5192
  var SESSION_ID = params.session_id;
@@ -1677,7 +1677,7 @@ func.datasource.create = async function (
1677
1677
  if (_session.DS_GLB[parentDataSourceNoP]._run_at) run_at = _session.DS_GLB[parentDataSourceNoP].v.run_at;
1678
1678
  }
1679
1679
 
1680
- const done = function (SESSION_ID, dsSessionP, is_serverP) {
1680
+ const done = function (SESSION_ID, dsSessionP, response_returned_from_worker) {
1681
1681
  var _ds = SESSION_OBJ[SESSION_ID].DS_GLB[dsSessionP];
1682
1682
 
1683
1683
  if (IS_DATASOURCE_REFRESH) {
@@ -1715,7 +1715,8 @@ func.datasource.create = async function (
1715
1715
 
1716
1716
  let interval = setInterval(() => {
1717
1717
  let idle_count = 0;
1718
- for (const _ds of ds_connected) {
1718
+ for (const dsSession of ds_connected) {
1719
+ const _ds = _session.DS_GLB[dsSession];
1719
1720
  if (_ds.stat == 'idle') {
1720
1721
  idle_count++;
1721
1722
  }
@@ -1727,7 +1728,6 @@ func.datasource.create = async function (
1727
1728
  }, 1000);
1728
1729
  };
1729
1730
 
1730
- // _ds.stat = "idle";
1731
1731
  set_stat_idle();
1732
1732
  resolve({
1733
1733
  SESSION_ID,
@@ -1768,7 +1768,7 @@ func.datasource.create = async function (
1768
1768
  );
1769
1769
  return done(SESSION_ID, ret.dsSessionP);
1770
1770
  }
1771
-
1771
+ // vvvv run at worker vvvv
1772
1772
  if (_ds) IS_DATASOURCE_REFRESH = true;
1773
1773
  var data = _.assignIn(
1774
1774
  {
@@ -5173,8 +5173,8 @@ func.utils.ws_worker.functions = {
5173
5173
  args.run_atP,
5174
5174
  args.worker_id,
5175
5175
  );
5176
-
5177
- if (show_log) console.log('DATASOURCE EXECUTION DONE ' + ret.dsSessionP + ' ' + _session.DS_GLB[ret.dsSessionP]?.tree_obj?.menuName || '' + ' SESSION_ID: ' + SESSION_ID, APP_OBJ[_session.app_id].app_name);
5176
+ let _ds = _session.DS_GLB[ret.dsSessionP];
5177
+ if (show_log) console.log('DATASOURCE EXECUTION DONE ' + ret.dsSessionP + ' ' + _ds?.tree_obj?.menuName || '' + ' SESSION_ID: ' + SESSION_ID, APP_OBJ[_session.app_id].app_name);
5178
5178
  var obj = func.utils.clean_returned_datasource(SESSION_ID, ret?.dsSessionP);
5179
5179
  obj.dataSourceSessionGlobal = _session.dataSourceSessionGlobal;
5180
5180
 
@@ -5186,6 +5186,7 @@ func.utils.ws_worker.functions = {
5186
5186
  process_pid: params.process_pid,
5187
5187
  service: params.service,
5188
5188
  });
5189
+ _ds.stat = 'idle';
5189
5190
  },
5190
5191
  datasource_delete: function (params, promise_queue_id) {
5191
5192
  var SESSION_ID = params.session_id;