@nsshunt/stsrunnerframework 1.0.85 → 1.0.86

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.
@@ -2228,10 +2228,12 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
2228
2228
  __privateGet(this, _debug2).call(this, chalk.grey(`Ending publish for runner: [${JSON.stringify(runnerEx.asyncRunnerContext)}]`));
2229
2229
  runnerEx.publishInstrumentController.EndPublish();
2230
2230
  }
2231
- const runner = this.CreateRunnerCopy(runnerEx);
2232
- __privateGet(this, _archiveList).push(runner);
2233
- if (__privateGet(this, _archiveList).length > __privateGet(this, _options2).maxArchiveListLength) {
2234
- __privateGet(this, _archiveList).shift();
2231
+ if (runnerEx.state !== IRunnerState.terminated) {
2232
+ const runner = this.CreateRunnerCopy(runnerEx);
2233
+ __privateGet(this, _archiveList).push(runner);
2234
+ if (__privateGet(this, _archiveList).length > __privateGet(this, _options2).maxArchiveListLength) {
2235
+ __privateGet(this, _archiveList).shift();
2236
+ }
2235
2237
  }
2236
2238
  delete workerEx.runnersEx[removeList[i].runnerId];
2237
2239
  }
@@ -2696,13 +2698,14 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
2696
2698
  try {
2697
2699
  const retVal = __privateGet(this, _BroadcastCommandToAllRunners).call(this, workerEx, __privateGet(this, _TerminateRunner2));
2698
2700
  if (workerEx.worker) {
2699
- workerEx.worker.terminate();
2700
- __privateGet(this, _debug2).call(this, `Terminated worker: [${workerEx.id}]`);
2701
- if (__privateGet(this, _workersEx)[workerEx.id]) {
2702
- delete __privateGet(this, _workersEx)[workerEx.id];
2703
- console.log(chalk.magenta(`STSWorkerManager:stsWorkerEx.worker.on(exit): Worker: [${workerEx.id}] has been removed from the worker collection.`));
2704
- }
2705
- } else {
2701
+ setTimeout(() => {
2702
+ workerEx.worker.terminate();
2703
+ __privateGet(this, _debug2).call(this, `Terminated worker: [${workerEx.id}]`);
2704
+ if (__privateGet(this, _workersEx)[workerEx.id]) {
2705
+ delete __privateGet(this, _workersEx)[workerEx.id];
2706
+ console.log(chalk.magenta(`STSWorkerManager:stsWorkerEx.worker.on(exit): Worker: [${workerEx.id}] has been removed from the worker collection.`));
2707
+ }
2708
+ }, 500);
2706
2709
  }
2707
2710
  return retVal;
2708
2711
  } catch (error) {