@nsshunt/stsrunnerframework 2.0.5 → 2.0.6
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
|
-
|
|
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
|
-
|
|
5741
|
-
|
|
5742
|
-
|
|
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(
|
|
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
|
};
|