@xuda.io/runtime-bundle 1.0.1383 → 1.0.1384

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.
@@ -8469,6 +8469,7 @@ func.UI.utils.get_panels_wrapper_from_dom = async function (SESSION_ID, $xu_embe
8469
8469
 
8470
8470
  func.UI.worker = {};
8471
8471
  func.UI.worker.ID = null;
8472
+ func.UI.worker.idle = 0;
8472
8473
  func.UI.worker.init = async function (SESSION_ID) {
8473
8474
  $.fn.isInViewport = function () {
8474
8475
  var elementTop = $(this).offset().top;
@@ -8482,35 +8483,35 @@ func.UI.worker.init = async function (SESSION_ID) {
8482
8483
 
8483
8484
  let last_job_in_queue = 0;
8484
8485
  // let run_stat;
8485
- const job_iterator2 = async function () {
8486
- let from_job_num_to_run = last_job_in_queue;
8487
- last_job_in_queue = UI_WORKER_OBJ.num - from_job_num_to_run;
8488
-
8489
- if (typeof UI_WORKER_OBJ.stat === 'undefined' || UI_WORKER_OBJ.stat === 'undefined' || UI_WORKER_OBJ.stat === null) {
8490
- // idle
8491
- this.attempt = 0;
8492
- if (UI_WORKER_OBJ.jobs.length) {
8493
- // clearInterval(this._interval);
8494
- for await (const [key, val] of Object.entries(UI_WORKER_OBJ.jobs)) {
8495
- // if (val.job_num < from_job_num_to_run) continue;
8496
- try {
8497
- if (val.stat) {
8498
- break;
8499
- }
8500
-
8501
- await func.UI.worker.execute(val.SESSION_ID, val);
8502
- // break;
8503
- } catch (err) {
8504
- console.error(err);
8505
- }
8506
- }
8507
- }
8508
- } else {
8509
- //busy
8486
+ // const job_iterator2 = async function () {
8487
+ // let from_job_num_to_run = last_job_in_queue;
8488
+ // last_job_in_queue = UI_WORKER_OBJ.num - from_job_num_to_run;
8489
+
8490
+ // if (typeof UI_WORKER_OBJ.stat === 'undefined' || UI_WORKER_OBJ.stat === 'undefined' || UI_WORKER_OBJ.stat === null) {
8491
+ // // idle
8492
+ // this.attempt = 0;
8493
+ // if (UI_WORKER_OBJ.jobs.length) {
8494
+ // // clearInterval(this._interval);
8495
+ // for await (const [key, val] of Object.entries(UI_WORKER_OBJ.jobs)) {
8496
+ // // if (val.job_num < from_job_num_to_run) continue;
8497
+ // try {
8498
+ // if (val.stat) {
8499
+ // break;
8500
+ // }
8501
+
8502
+ // await func.UI.worker.execute(val.SESSION_ID, val);
8503
+ // // break;
8504
+ // } catch (err) {
8505
+ // console.error(err);
8506
+ // }
8507
+ // }
8508
+ // }
8509
+ // } else {
8510
+ // //busy
8510
8511
 
8511
- this.attempt++;
8512
- }
8513
- };
8512
+ // this.attempt++;
8513
+ // }
8514
+ // };
8514
8515
 
8515
8516
  const job_iterator = async function () {
8516
8517
  let from_job_num_to_run = last_job_in_queue;
@@ -8519,7 +8520,9 @@ func.UI.worker.init = async function (SESSION_ID) {
8519
8520
  // if (typeof UI_WORKER_OBJ.stat === 'undefined' || UI_WORKER_OBJ.stat === 'undefined' || UI_WORKER_OBJ.stat === null) {
8520
8521
  // idle
8521
8522
  this.attempt = 0;
8523
+
8522
8524
  if (UI_WORKER_OBJ.jobs.length) {
8525
+ func.UI.worker.idle = 0;
8523
8526
  let running_job_children_elements = [];
8524
8527
  let active_job_children_elements = [];
8525
8528
  for await (const [key, val] of Object.entries(UI_WORKER_OBJ.jobs)) {
@@ -8614,6 +8617,17 @@ func.UI.worker.init = async function (SESSION_ID) {
8614
8617
  console.error(err);
8615
8618
  }
8616
8619
  }
8620
+ } else {
8621
+ func.UI.worker.idle++;
8622
+
8623
+ if (func.UI.worker.idle > 1000) {
8624
+ // cleaning pending_to_delete
8625
+ $.each($('body').find('*'), (key, val) => {
8626
+ if ($(val)?.data()?.xuData?.pending_to_delete) {
8627
+ $(val).data().xuData.pending_to_delete = false;
8628
+ }
8629
+ });
8630
+ }
8617
8631
  }
8618
8632
  // } else {
8619
8633
  // //busy
@@ -8470,6 +8470,7 @@ func.UI.utils.get_panels_wrapper_from_dom = async function (SESSION_ID, $xu_embe
8470
8470
 
8471
8471
  func.UI.worker = {};
8472
8472
  func.UI.worker.ID = null;
8473
+ func.UI.worker.idle = 0;
8473
8474
  func.UI.worker.init = async function (SESSION_ID) {
8474
8475
  $.fn.isInViewport = function () {
8475
8476
  var elementTop = $(this).offset().top;
@@ -8483,35 +8484,35 @@ func.UI.worker.init = async function (SESSION_ID) {
8483
8484
 
8484
8485
  let last_job_in_queue = 0;
8485
8486
  // let run_stat;
8486
- const job_iterator2 = async function () {
8487
- let from_job_num_to_run = last_job_in_queue;
8488
- last_job_in_queue = UI_WORKER_OBJ.num - from_job_num_to_run;
8489
-
8490
- if (typeof UI_WORKER_OBJ.stat === 'undefined' || UI_WORKER_OBJ.stat === 'undefined' || UI_WORKER_OBJ.stat === null) {
8491
- // idle
8492
- this.attempt = 0;
8493
- if (UI_WORKER_OBJ.jobs.length) {
8494
- // clearInterval(this._interval);
8495
- for await (const [key, val] of Object.entries(UI_WORKER_OBJ.jobs)) {
8496
- // if (val.job_num < from_job_num_to_run) continue;
8497
- try {
8498
- if (val.stat) {
8499
- break;
8500
- }
8501
-
8502
- await func.UI.worker.execute(val.SESSION_ID, val);
8503
- // break;
8504
- } catch (err) {
8505
- console.error(err);
8506
- }
8507
- }
8508
- }
8509
- } else {
8510
- //busy
8487
+ // const job_iterator2 = async function () {
8488
+ // let from_job_num_to_run = last_job_in_queue;
8489
+ // last_job_in_queue = UI_WORKER_OBJ.num - from_job_num_to_run;
8490
+
8491
+ // if (typeof UI_WORKER_OBJ.stat === 'undefined' || UI_WORKER_OBJ.stat === 'undefined' || UI_WORKER_OBJ.stat === null) {
8492
+ // // idle
8493
+ // this.attempt = 0;
8494
+ // if (UI_WORKER_OBJ.jobs.length) {
8495
+ // // clearInterval(this._interval);
8496
+ // for await (const [key, val] of Object.entries(UI_WORKER_OBJ.jobs)) {
8497
+ // // if (val.job_num < from_job_num_to_run) continue;
8498
+ // try {
8499
+ // if (val.stat) {
8500
+ // break;
8501
+ // }
8502
+
8503
+ // await func.UI.worker.execute(val.SESSION_ID, val);
8504
+ // // break;
8505
+ // } catch (err) {
8506
+ // console.error(err);
8507
+ // }
8508
+ // }
8509
+ // }
8510
+ // } else {
8511
+ // //busy
8511
8512
 
8512
- this.attempt++;
8513
- }
8514
- };
8513
+ // this.attempt++;
8514
+ // }
8515
+ // };
8515
8516
 
8516
8517
  const job_iterator = async function () {
8517
8518
  let from_job_num_to_run = last_job_in_queue;
@@ -8520,7 +8521,9 @@ func.UI.worker.init = async function (SESSION_ID) {
8520
8521
  // if (typeof UI_WORKER_OBJ.stat === 'undefined' || UI_WORKER_OBJ.stat === 'undefined' || UI_WORKER_OBJ.stat === null) {
8521
8522
  // idle
8522
8523
  this.attempt = 0;
8524
+
8523
8525
  if (UI_WORKER_OBJ.jobs.length) {
8526
+ func.UI.worker.idle = 0;
8524
8527
  let running_job_children_elements = [];
8525
8528
  let active_job_children_elements = [];
8526
8529
  for await (const [key, val] of Object.entries(UI_WORKER_OBJ.jobs)) {
@@ -8615,6 +8618,17 @@ func.UI.worker.init = async function (SESSION_ID) {
8615
8618
  console.error(err);
8616
8619
  }
8617
8620
  }
8621
+ } else {
8622
+ func.UI.worker.idle++;
8623
+
8624
+ if (func.UI.worker.idle > 1000) {
8625
+ // cleaning pending_to_delete
8626
+ $.each($('body').find('*'), (key, val) => {
8627
+ if ($(val)?.data()?.xuData?.pending_to_delete) {
8628
+ $(val).data().xuData.pending_to_delete = false;
8629
+ }
8630
+ });
8631
+ }
8618
8632
  }
8619
8633
  // } else {
8620
8634
  // //busy