Implemented infinite loop safety net.

This commit is contained in:
Olivier Gagnon
2022-05-07 17:43:45 -04:00
parent b46718d188
commit fb08139903
6 changed files with 30 additions and 0 deletions
+5
View File
@@ -111,6 +111,11 @@ export class WorkerScript {
*/
atExit: any;
/**
* Once this counter reaches it's limit the script crashes. It is reset when a promise completes.
*/
infiniteLoopSafetyCounter = 0;
constructor(runningScriptObj: RunningScript, pid: number, nsFuncsGenerator?: (ws: WorkerScript) => any) {
this.name = runningScriptObj.filename;
this.hostname = runningScriptObj.server;