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