@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.
@@ -5611,7 +5611,7 @@ ${runnerId}`,
5611
5611
  * This is stored so the loop can be stopped later via {@link Terminate}.
5612
5612
  */
5613
5613
  timeout;
5614
- archiveDelTimeout;
5614
+ archiveDelTimeout = {};
5615
5615
  /**
5616
5616
  * Construct a new archive manager.
5617
5617
  *
@@ -5729,17 +5729,21 @@ ${runnerId}`,
5729
5729
  * This removes the runner from the active runtime graph after a delay.
5730
5730
  */
5731
5731
  if (this.archiveDeleteTimeout !== 0) {
5732
- this.archiveDelTimeout = setTimeout(() => {
5732
+ const delTimeoutId = v4();
5733
+ const delTimeout = setTimeout(() => {
5733
5734
  try {
5734
5735
  this.options.workerRegistry.DeleteRunner(workerEx.id, removeList[i].runnerId);
5735
5736
  } catch (error) {
5736
5737
  this.options.logger.error(`Error in: this.options.workerRegistry.DeleteRunner(${workerEx.id}, ${removeList[i].runnerId})`);
5737
5738
  }
5739
+ delete this.archiveDelTimeout[delTimeoutId];
5738
5740
  }, this.archiveDeleteTimeout * 1e3);
5739
- /**
5740
- * In Node.js, unref the timer so it does not keep the process alive.
5741
- */
5742
- if (detect_node.default) this.archiveDelTimeout.unref();
5741
+ if (detect_node.default) delTimeout.unref();
5742
+ this.archiveDelTimeout[delTimeoutId] = {
5743
+ workerId: workerEx.id,
5744
+ runnerId: removeList[i].runnerId,
5745
+ delTimeout
5746
+ };
5743
5747
  }
5744
5748
  }
5745
5749
  }
@@ -5818,13 +5822,14 @@ ${runnerId}`,
5818
5822
  */
5819
5823
  Terminate = () => {
5820
5824
  this.options.logger.debug(`ArchiveManager:Terminate()`);
5825
+ this.options.logger.debug(`Runtime context: isNode = [${detect_node.default}]`);
5821
5826
  if (this.timeout) {
5822
5827
  this.options.logger.debug(`ArchiveManager:Terminate() - this.timeout cleared ...`);
5823
5828
  clearTimeout(this.timeout);
5824
5829
  }
5825
- if (this.archiveDelTimeout) {
5826
- this.options.logger.debug(`ArchiveManager:Terminate() - this.archiveDelTimeout cleared ...`);
5827
- clearTimeout(this.archiveDelTimeout);
5830
+ if (this.archiveDelTimeout) for (const [delKey, delTimeoutRecord] of Object.entries(this.archiveDelTimeout)) {
5831
+ this.options.logger.debug(`ArchiveManager:Terminate() - this.archiveDelTimeout: [${delKey}] cleared for workerId: [${delTimeoutRecord.workerId}] runnerId: [${delTimeoutRecord.runnerId}]`);
5832
+ clearTimeout(delTimeoutRecord.delTimeout);
5828
5833
  }
5829
5834
  };
5830
5835
  };
@@ -7921,7 +7926,7 @@ ${runnerId}`,
7921
7926
  * @param message Log message.
7922
7927
  */
7923
7928
  #debug = (message) => {
7924
- if (this.#options && this.#options.logLevel >= 4) this.#logMessage(this.#options.logger.debug, message);
7929
+ if (this.#options && this.#options.logLevel >= 4) {}
7925
7930
  };
7926
7931
  /**
7927
7932
  * Log at error level when enabled by manager options.