@nsshunt/stsrunnerframework 1.0.136 → 1.0.138

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.
@@ -1815,14 +1815,18 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
1815
1815
  await stsutils.Sleep(0);
1816
1816
  const startLoop = /* @__PURE__ */ new Date();
1817
1817
  const ExecuteLoop = async () => {
1818
- var _a2, _b;
1818
+ var _a2, _b, _c;
1819
1819
  try {
1820
1820
  let cont = true;
1821
1821
  const executionProfile = __privateGet(this, _GetRunnerExecutionProfileById).call(this, runnerId);
1822
1822
  if (executionProfile) {
1823
- const { iterations, duration, delayBetweenIterations } = executionProfile;
1823
+ const { iterations, duration, delayBetweenIterations, pauseOnComplete } = executionProfile;
1824
1824
  if (iterations > 0) {
1825
- cont = __privateGet(this, _GetRunnerIterationById).call(this, runnerId) < iterations;
1825
+ if (pauseOnComplete === true) {
1826
+ cont = __privateGet(this, _GetRunnerIterationById).call(this, runnerId) <= iterations;
1827
+ } else {
1828
+ cont = __privateGet(this, _GetRunnerIterationById).call(this, runnerId) < iterations;
1829
+ }
1826
1830
  } else if (duration > 0) {
1827
1831
  cont = ((/* @__PURE__ */ new Date()).getTime() - startLoop.getTime()) / 1e3 < duration;
1828
1832
  }
@@ -1847,8 +1851,14 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
1847
1851
  }
1848
1852
  }
1849
1853
  } else {
1850
- await ((_b = __privateGet(this, _GetRunnerInstanceById).call(this, runnerId)) == null ? void 0 : _b.Completed());
1851
- __privateGet(this, _UpdateRunnerStateById).call(this, runnerId, IRunnerState.completed);
1854
+ if (pauseOnComplete === true) {
1855
+ await ((_b = __privateGet(this, _GetRunnerInstanceById).call(this, runnerId)) == null ? void 0 : _b.PauseRunner());
1856
+ __privateGet(this, _UpdateRunnerStateById).call(this, runnerId, IRunnerState.paused);
1857
+ ExecuteLoop();
1858
+ } else {
1859
+ await ((_c = __privateGet(this, _GetRunnerInstanceById).call(this, runnerId)) == null ? void 0 : _c.Completed());
1860
+ __privateGet(this, _UpdateRunnerStateById).call(this, runnerId, IRunnerState.completed);
1861
+ }
1852
1862
  }
1853
1863
  } else {
1854
1864
  __privateGet(this, _warn).call(this, `#StartRunner:ExecuteLoop(): Cannot get execution profile for runner: [${runnerId}]`);