@nsshunt/stsrunnerframework 2.0.5 → 2.0.7

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.
@@ -5604,7 +5604,7 @@ var ArchiveManager = class {
5604
5604
  * This is stored so the loop can be stopped later via {@link Terminate}.
5605
5605
  */
5606
5606
  timeout;
5607
- archiveDelTimeout;
5607
+ archiveDelTimeout = {};
5608
5608
  /**
5609
5609
  * Construct a new archive manager.
5610
5610
  *
@@ -5722,17 +5722,21 @@ var ArchiveManager = class {
5722
5722
  * This removes the runner from the active runtime graph after a delay.
5723
5723
  */
5724
5724
  if (this.archiveDeleteTimeout !== 0) {
5725
- this.archiveDelTimeout = setTimeout(() => {
5725
+ const delTimeoutId = v4();
5726
+ const delTimeout = setTimeout(() => {
5726
5727
  try {
5727
5728
  this.options.workerRegistry.DeleteRunner(workerEx.id, removeList[i].runnerId);
5728
5729
  } catch (error) {
5729
5730
  this.options.logger.error(`Error in: this.options.workerRegistry.DeleteRunner(${workerEx.id}, ${removeList[i].runnerId})`);
5730
5731
  }
5732
+ delete this.archiveDelTimeout[delTimeoutId];
5731
5733
  }, this.archiveDeleteTimeout * 1e3);
5732
- /**
5733
- * In Node.js, unref the timer so it does not keep the process alive.
5734
- */
5735
- if (isNode) this.archiveDelTimeout.unref();
5734
+ if (isNode) delTimeout.unref();
5735
+ this.archiveDelTimeout[delTimeoutId] = {
5736
+ workerId: workerEx.id,
5737
+ runnerId: removeList[i].runnerId,
5738
+ delTimeout
5739
+ };
5736
5740
  }
5737
5741
  }
5738
5742
  }
@@ -5811,13 +5815,14 @@ var ArchiveManager = class {
5811
5815
  */
5812
5816
  Terminate = () => {
5813
5817
  this.options.logger.debug(`ArchiveManager:Terminate()`);
5818
+ this.options.logger.debug(`Runtime context: isNode = [${isNode}]`);
5814
5819
  if (this.timeout) {
5815
5820
  this.options.logger.debug(`ArchiveManager:Terminate() - this.timeout cleared ...`);
5816
5821
  clearTimeout(this.timeout);
5817
5822
  }
5818
- if (this.archiveDelTimeout) {
5819
- this.options.logger.debug(`ArchiveManager:Terminate() - this.archiveDelTimeout cleared ...`);
5820
- clearTimeout(this.archiveDelTimeout);
5823
+ if (this.archiveDelTimeout) for (const [delKey, delTimeoutRecord] of Object.entries(this.archiveDelTimeout)) {
5824
+ this.options.logger.debug(`ArchiveManager:Terminate() - this.archiveDelTimeout: [${delKey}] cleared for workerId: [${delTimeoutRecord.workerId}] runnerId: [${delTimeoutRecord.runnerId}]`);
5825
+ clearTimeout(delTimeoutRecord.delTimeout);
5821
5826
  }
5822
5827
  };
5823
5828
  };
@@ -7914,7 +7919,7 @@ var STSWorkerManager = class {
7914
7919
  * @param message Log message.
7915
7920
  */
7916
7921
  #debug = (message) => {
7917
- if (this.#options && this.#options.logLevel >= 4) this.#logMessage(this.#options.logger.debug, message);
7922
+ if (this.#options && this.#options.logLevel >= 4) {}
7918
7923
  };
7919
7924
  /**
7920
7925
  * Log at error level when enabled by manager options.