@resolveio/server-lib 22.3.1 → 22.3.3
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.
- package/collections/email-history.collection.js +5 -0
- package/collections/email-history.collection.js.map +1 -1
- package/managers/method.manager.d.ts +1 -0
- package/managers/method.manager.js +4 -1
- package/managers/method.manager.js.map +1 -1
- package/models/email-history.model.d.ts +1 -0
- package/models/email-history.model.js.map +1 -1
- package/package.json +3 -3
- package/server-app.d.ts +5 -0
- package/server-app.js +180 -81
- package/server-app.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@resolveio/server-lib",
|
|
3
|
-
"version": "22.3.
|
|
3
|
+
"version": "22.3.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"package": "./build_package.sh",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"path": "0.12.7",
|
|
61
61
|
"pdf-lib": "1.17.1",
|
|
62
62
|
"pm2": "7.0.1",
|
|
63
|
-
"puppeteer": "24.
|
|
63
|
+
"puppeteer": "24.43.0",
|
|
64
64
|
"rus-diff": "1.1.0",
|
|
65
65
|
"rxjs": "7.8.2",
|
|
66
66
|
"scmp": "2.1.0",
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
"path": "0.12.7",
|
|
126
126
|
"pdf-lib": "1.17.1",
|
|
127
127
|
"pm2": "7.0.1",
|
|
128
|
-
"puppeteer": "24.
|
|
128
|
+
"puppeteer": "24.43.0",
|
|
129
129
|
"rus-diff": "1.1.0",
|
|
130
130
|
"scmp": "2.1.0",
|
|
131
131
|
"simpl-schema": "1.12.0",
|
package/server-app.d.ts
CHANGED
|
@@ -63,11 +63,13 @@ export declare class ResolveIOMainServer {
|
|
|
63
63
|
private _standaloneNodeReaperHighMinAgeSeconds;
|
|
64
64
|
private _standaloneNodeReaperHighConsecutiveScans;
|
|
65
65
|
private _standaloneNodeReaperDryRun;
|
|
66
|
+
private _standaloneNodeReaperAlertWindowMs;
|
|
66
67
|
private _standaloneNodeReaperTimer;
|
|
67
68
|
private _standaloneNodeReaperRunning;
|
|
68
69
|
private _standaloneNodeReaperKillCounts;
|
|
69
70
|
private _standaloneNodeReaperSuppressedSignatures;
|
|
70
71
|
private _standaloneNodeReaperResourceHits;
|
|
72
|
+
private _standaloneNodeReaperAlertTimes;
|
|
71
73
|
private _serverStartTime;
|
|
72
74
|
private _lastErrorMsg;
|
|
73
75
|
private _debugMsgRecv;
|
|
@@ -91,6 +93,8 @@ export declare class ResolveIOMainServer {
|
|
|
91
93
|
private startAiAssistantCodexManagerIfEnabled;
|
|
92
94
|
private startStandaloneNodeReaper;
|
|
93
95
|
private reapStandaloneNodeProcesses;
|
|
96
|
+
private createStandaloneNodeReaperDetails;
|
|
97
|
+
private reportStandaloneNodeReaperAction;
|
|
94
98
|
private listSystemProcesses;
|
|
95
99
|
private parseProcessSnapshot;
|
|
96
100
|
private execFileText;
|
|
@@ -174,6 +178,7 @@ export declare class ResolveIOMainServer {
|
|
|
174
178
|
private resolveStandaloneNodeReaperHighMinAgeSeconds;
|
|
175
179
|
private resolveStandaloneNodeReaperHighConsecutiveScans;
|
|
176
180
|
private resolveStandaloneNodeReaperDryRun;
|
|
181
|
+
private resolveStandaloneNodeReaperAlertWindowMs;
|
|
177
182
|
private isPm2ManagedRuntime;
|
|
178
183
|
private isPrimaryPm2Instance;
|
|
179
184
|
private isLocalRuntime;
|
package/server-app.js
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
2
13
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
14
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
15
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -178,11 +189,13 @@ var ResolveIOMainServer = /** @class */ (function () {
|
|
|
178
189
|
this._standaloneNodeReaperHighMinAgeSeconds = 60;
|
|
179
190
|
this._standaloneNodeReaperHighConsecutiveScans = 2;
|
|
180
191
|
this._standaloneNodeReaperDryRun = false;
|
|
192
|
+
this._standaloneNodeReaperAlertWindowMs = 60 * 60 * 1000;
|
|
181
193
|
this._standaloneNodeReaperTimer = null;
|
|
182
194
|
this._standaloneNodeReaperRunning = false;
|
|
183
195
|
this._standaloneNodeReaperKillCounts = new Map();
|
|
184
196
|
this._standaloneNodeReaperSuppressedSignatures = new Set();
|
|
185
197
|
this._standaloneNodeReaperResourceHits = new Map();
|
|
198
|
+
this._standaloneNodeReaperAlertTimes = new Map();
|
|
186
199
|
this._lastErrorMsg = null;
|
|
187
200
|
this._debugMsgRecv = 0;
|
|
188
201
|
this._debugMsgQueue = 0;
|
|
@@ -249,6 +262,7 @@ var ResolveIOMainServer = /** @class */ (function () {
|
|
|
249
262
|
this._standaloneNodeReaperHighMinAgeSeconds = this.resolveStandaloneNodeReaperHighMinAgeSeconds();
|
|
250
263
|
this._standaloneNodeReaperHighConsecutiveScans = this.resolveStandaloneNodeReaperHighConsecutiveScans();
|
|
251
264
|
this._standaloneNodeReaperDryRun = this.resolveStandaloneNodeReaperDryRun();
|
|
265
|
+
this._standaloneNodeReaperAlertWindowMs = this.resolveStandaloneNodeReaperAlertWindowMs();
|
|
252
266
|
this._dynamicAppGatewayEnabled = this.resolveDynamicAppGatewayEnabled();
|
|
253
267
|
this._socketTier = this.resolveSocketTier();
|
|
254
268
|
this._maxClientSockets = this.resolveMaxClientSockets(this._socketTier);
|
|
@@ -596,13 +610,15 @@ var ResolveIOMainServer = /** @class */ (function () {
|
|
|
596
610
|
highRssMb: this._standaloneNodeReaperHighRssMb,
|
|
597
611
|
highMinAgeSeconds: this._standaloneNodeReaperHighMinAgeSeconds,
|
|
598
612
|
highConsecutiveScans: this._standaloneNodeReaperHighConsecutiveScans,
|
|
613
|
+
alertWindowMs: this._standaloneNodeReaperAlertWindowMs,
|
|
599
614
|
dryRun: this._standaloneNodeReaperDryRun
|
|
600
615
|
});
|
|
601
616
|
};
|
|
602
617
|
ResolveIOMainServer.prototype.reapStandaloneNodeProcesses = function () {
|
|
603
618
|
return __awaiter(this, void 0, void 0, function () {
|
|
604
|
-
var processes, protectedPids, _loop_1, this_1, processes_1, processes_1_1, proc;
|
|
619
|
+
var processes, protectedPids, _loop_1, this_1, processes_1, processes_1_1, proc, e_1_1;
|
|
605
620
|
var e_1, _a;
|
|
621
|
+
var _this = this;
|
|
606
622
|
var _b;
|
|
607
623
|
return __generator(this, function (_c) {
|
|
608
624
|
switch (_c.label) {
|
|
@@ -613,88 +629,165 @@ var ResolveIOMainServer = /** @class */ (function () {
|
|
|
613
629
|
this._standaloneNodeReaperRunning = true;
|
|
614
630
|
_c.label = 1;
|
|
615
631
|
case 1:
|
|
616
|
-
_c.trys.push([1, ,
|
|
632
|
+
_c.trys.push([1, , 11, 12]);
|
|
617
633
|
return [4 /*yield*/, this.listSystemProcesses()];
|
|
618
634
|
case 2:
|
|
619
635
|
processes = _c.sent();
|
|
620
636
|
protectedPids = this.resolvePm2ProtectedPids(processes);
|
|
621
637
|
_loop_1 = function (proc) {
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
638
|
+
var signature, reason, details, details, killTimer, error_6;
|
|
639
|
+
return __generator(this, function (_d) {
|
|
640
|
+
switch (_d.label) {
|
|
641
|
+
case 0:
|
|
642
|
+
if (!this_1.shouldReapStandaloneNodeProcess(proc, protectedPids)) {
|
|
643
|
+
return [2 /*return*/, "continue"];
|
|
644
|
+
}
|
|
645
|
+
signature = this_1.resolveStandaloneNodeProcessSignature(proc);
|
|
646
|
+
if (!this_1.canReapStandaloneNodeSignature(signature)) {
|
|
647
|
+
this_1.logStandaloneNodeReaperSuppressed(proc, signature);
|
|
648
|
+
return [2 /*return*/, "continue"];
|
|
649
|
+
}
|
|
650
|
+
reason = this_1.resolveStandaloneNodeReaperReason(proc);
|
|
651
|
+
if (!this_1._standaloneNodeReaperDryRun) return [3 /*break*/, 2];
|
|
652
|
+
this_1.recordStandaloneNodeReaperKill(signature);
|
|
653
|
+
details = this_1.createStandaloneNodeReaperDetails(proc, reason, 'dry-run');
|
|
654
|
+
console.warn(new Date(), '[Standalone Node Reaper] dry-run would terminate stale node process', details);
|
|
655
|
+
return [4 /*yield*/, this_1.reportStandaloneNodeReaperAction(proc, reason, 'dry-run')];
|
|
656
|
+
case 1:
|
|
657
|
+
_d.sent();
|
|
658
|
+
return [2 /*return*/, "continue"];
|
|
659
|
+
case 2:
|
|
660
|
+
_d.trys.push([2, 4, , 5]);
|
|
661
|
+
process.kill(proc.pid, 'SIGTERM');
|
|
662
|
+
this_1.recordStandaloneNodeReaperKill(signature);
|
|
663
|
+
details = this_1.createStandaloneNodeReaperDetails(proc, reason, 'terminated');
|
|
664
|
+
console.warn(new Date(), '[Standalone Node Reaper] terminated stale node process', details);
|
|
665
|
+
return [4 /*yield*/, this_1.reportStandaloneNodeReaperAction(proc, reason, 'terminated')];
|
|
666
|
+
case 3:
|
|
667
|
+
_d.sent();
|
|
668
|
+
killTimer = setTimeout(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
669
|
+
var _a;
|
|
670
|
+
return __generator(this, function (_b) {
|
|
671
|
+
switch (_b.label) {
|
|
672
|
+
case 0:
|
|
673
|
+
_b.trys.push([0, 2, , 3]);
|
|
674
|
+
process.kill(proc.pid, 0);
|
|
675
|
+
process.kill(proc.pid, 'SIGKILL');
|
|
676
|
+
console.warn(new Date(), '[Standalone Node Reaper] force killed stale node process', {
|
|
677
|
+
pid: proc.pid,
|
|
678
|
+
reason: reason,
|
|
679
|
+
command: proc.args
|
|
680
|
+
});
|
|
681
|
+
return [4 /*yield*/, this.reportStandaloneNodeReaperAction(proc, reason, 'force-killed')];
|
|
682
|
+
case 1:
|
|
683
|
+
_b.sent();
|
|
684
|
+
return [3 /*break*/, 3];
|
|
685
|
+
case 2:
|
|
686
|
+
_a = _b.sent();
|
|
687
|
+
return [3 /*break*/, 3];
|
|
688
|
+
case 3: return [2 /*return*/];
|
|
689
|
+
}
|
|
690
|
+
});
|
|
691
|
+
}); }, 10000);
|
|
692
|
+
(_b = killTimer.unref) === null || _b === void 0 ? void 0 : _b.call(killTimer);
|
|
693
|
+
return [3 /*break*/, 5];
|
|
694
|
+
case 4:
|
|
695
|
+
error_6 = _d.sent();
|
|
696
|
+
if ((error_6 === null || error_6 === void 0 ? void 0 : error_6['code']) !== 'ESRCH') {
|
|
697
|
+
console.error(new Date(), '[Standalone Node Reaper] kill failed', {
|
|
698
|
+
pid: proc.pid,
|
|
699
|
+
command: proc.args,
|
|
700
|
+
error: (error_6 === null || error_6 === void 0 ? void 0 : error_6['message']) || error_6
|
|
701
|
+
});
|
|
702
|
+
}
|
|
703
|
+
return [3 /*break*/, 5];
|
|
704
|
+
case 5: return [2 /*return*/];
|
|
677
705
|
}
|
|
678
|
-
}
|
|
706
|
+
});
|
|
679
707
|
};
|
|
680
708
|
this_1 = this;
|
|
709
|
+
_c.label = 3;
|
|
710
|
+
case 3:
|
|
711
|
+
_c.trys.push([3, 8, 9, 10]);
|
|
712
|
+
processes_1 = __values(processes), processes_1_1 = processes_1.next();
|
|
713
|
+
_c.label = 4;
|
|
714
|
+
case 4:
|
|
715
|
+
if (!!processes_1_1.done) return [3 /*break*/, 7];
|
|
716
|
+
proc = processes_1_1.value;
|
|
717
|
+
return [5 /*yield**/, _loop_1(proc)];
|
|
718
|
+
case 5:
|
|
719
|
+
_c.sent();
|
|
720
|
+
_c.label = 6;
|
|
721
|
+
case 6:
|
|
722
|
+
processes_1_1 = processes_1.next();
|
|
723
|
+
return [3 /*break*/, 4];
|
|
724
|
+
case 7: return [3 /*break*/, 10];
|
|
725
|
+
case 8:
|
|
726
|
+
e_1_1 = _c.sent();
|
|
727
|
+
e_1 = { error: e_1_1 };
|
|
728
|
+
return [3 /*break*/, 10];
|
|
729
|
+
case 9:
|
|
681
730
|
try {
|
|
682
|
-
|
|
683
|
-
proc = processes_1_1.value;
|
|
684
|
-
_loop_1(proc);
|
|
685
|
-
}
|
|
731
|
+
if (processes_1_1 && !processes_1_1.done && (_a = processes_1.return)) _a.call(processes_1);
|
|
686
732
|
}
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
733
|
+
finally { if (e_1) throw e_1.error; }
|
|
734
|
+
return [7 /*endfinally*/];
|
|
735
|
+
case 10: return [3 /*break*/, 12];
|
|
736
|
+
case 11:
|
|
737
|
+
this._standaloneNodeReaperRunning = false;
|
|
738
|
+
return [7 /*endfinally*/];
|
|
739
|
+
case 12: return [2 /*return*/];
|
|
740
|
+
}
|
|
741
|
+
});
|
|
742
|
+
});
|
|
743
|
+
};
|
|
744
|
+
ResolveIOMainServer.prototype.createStandaloneNodeReaperDetails = function (proc, reason, action) {
|
|
745
|
+
return {
|
|
746
|
+
action: action,
|
|
747
|
+
pid: proc.pid,
|
|
748
|
+
ppid: proc.ppid,
|
|
749
|
+
ageSeconds: proc.ageSeconds,
|
|
750
|
+
cpuPct: proc.cpuPct,
|
|
751
|
+
rssMb: (0, common_1.round)(proc.rssKb / 1024),
|
|
752
|
+
reason: reason,
|
|
753
|
+
command: proc.args
|
|
754
|
+
};
|
|
755
|
+
};
|
|
756
|
+
ResolveIOMainServer.prototype.reportStandaloneNodeReaperAction = function (proc, reason, action) {
|
|
757
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
758
|
+
var signature, alertKey, now, lastReportedAt, error_7;
|
|
759
|
+
var _a;
|
|
760
|
+
return __generator(this, function (_b) {
|
|
761
|
+
switch (_b.label) {
|
|
762
|
+
case 0:
|
|
763
|
+
signature = this.resolveStandaloneNodeProcessSignature(proc);
|
|
764
|
+
alertKey = "".concat(action, "|").concat(signature);
|
|
765
|
+
now = Date.now();
|
|
766
|
+
lastReportedAt = this._standaloneNodeReaperAlertTimes.get(alertKey);
|
|
767
|
+
if (lastReportedAt && (now - lastReportedAt) < this._standaloneNodeReaperAlertWindowMs) {
|
|
768
|
+
return [2 /*return*/];
|
|
693
769
|
}
|
|
770
|
+
_b.label = 1;
|
|
771
|
+
case 1:
|
|
772
|
+
_b.trys.push([1, 3, , 4]);
|
|
773
|
+
return [4 /*yield*/, this.reportServerError("SERVER - Standalone Node Reaper ".concat(action, " process - ").concat(((_a = resolveio_server_app_1.ResolveIOServer.getServerConfig()) === null || _a === void 0 ? void 0 : _a['CLIENT_NAME']) || resolveio_server_app_1.ResolveIOServer.getClientName()), crypto.randomUUID(), __assign(__assign({}, this.createStandaloneNodeReaperDetails(proc, reason, action)), { host: os.hostname(), workerIndex: process.env.WORKER_INDEX || null, workerInstance: process.env.NODE_APP_INSTANCE || null, dryRun: this._standaloneNodeReaperDryRun, alertWindowMs: this._standaloneNodeReaperAlertWindowMs }), {
|
|
774
|
+
context: 'standaloneNodeReaper',
|
|
775
|
+
action: action,
|
|
776
|
+
reason: reason,
|
|
777
|
+
signature: signature
|
|
778
|
+
}, 'warning')];
|
|
779
|
+
case 2:
|
|
780
|
+
_b.sent();
|
|
781
|
+
this._standaloneNodeReaperAlertTimes.set(alertKey, now);
|
|
694
782
|
return [3 /*break*/, 4];
|
|
695
783
|
case 3:
|
|
696
|
-
|
|
697
|
-
|
|
784
|
+
error_7 = _b.sent();
|
|
785
|
+
console.error(new Date(), '[Standalone Node Reaper] alert failed', {
|
|
786
|
+
action: action,
|
|
787
|
+
pid: proc.pid,
|
|
788
|
+
error: (error_7 === null || error_7 === void 0 ? void 0 : error_7['message']) || error_7
|
|
789
|
+
});
|
|
790
|
+
return [3 /*break*/, 4];
|
|
698
791
|
case 4: return [2 /*return*/];
|
|
699
792
|
}
|
|
700
793
|
});
|
|
@@ -1164,7 +1257,7 @@ var ResolveIOMainServer = /** @class */ (function () {
|
|
|
1164
1257
|
return;
|
|
1165
1258
|
}
|
|
1166
1259
|
this._app.use(function (req, res, next) { return __awaiter(_this, void 0, void 0, function () {
|
|
1167
|
-
var appId, appDoc, allowedHosts, controlHosts, requestHost, originHeader, originHost, expectedToken, providedToken,
|
|
1260
|
+
var appId, appDoc, allowedHosts, controlHosts, requestHost, originHeader, originHost, expectedToken, providedToken, error_8;
|
|
1168
1261
|
var _a, _b, _c;
|
|
1169
1262
|
return __generator(this, function (_d) {
|
|
1170
1263
|
switch (_d.label) {
|
|
@@ -1247,11 +1340,11 @@ var ResolveIOMainServer = /** @class */ (function () {
|
|
|
1247
1340
|
next();
|
|
1248
1341
|
return [3 /*break*/, 4];
|
|
1249
1342
|
case 3:
|
|
1250
|
-
|
|
1251
|
-
console.error(new Date(), '[DynamicAppGateway] middleware failure',
|
|
1343
|
+
error_8 = _d.sent();
|
|
1344
|
+
console.error(new Date(), '[DynamicAppGateway] middleware failure', error_8);
|
|
1252
1345
|
res.status(500).send(JSON.stringify({
|
|
1253
1346
|
error: true,
|
|
1254
|
-
result: (
|
|
1347
|
+
result: (error_8 === null || error_8 === void 0 ? void 0 : error_8.message) || 'Dynamic app gateway error.'
|
|
1255
1348
|
}));
|
|
1256
1349
|
return [3 /*break*/, 4];
|
|
1257
1350
|
case 4: return [2 /*return*/];
|
|
@@ -2077,7 +2170,7 @@ var ResolveIOMainServer = /** @class */ (function () {
|
|
|
2077
2170
|
// Do not block message handler registration on DB write; this avoids losing
|
|
2078
2171
|
// very-early subscription messages sent immediately after websocket open.
|
|
2079
2172
|
setTimeout(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
2080
|
-
var
|
|
2173
|
+
var error_9;
|
|
2081
2174
|
return __generator(this, function (_a) {
|
|
2082
2175
|
switch (_a.label) {
|
|
2083
2176
|
case 0:
|
|
@@ -2087,13 +2180,13 @@ var ResolveIOMainServer = /** @class */ (function () {
|
|
|
2087
2180
|
_a.sent();
|
|
2088
2181
|
return [3 /*break*/, 3];
|
|
2089
2182
|
case 2:
|
|
2090
|
-
|
|
2091
|
-
console.error(new Date(), 'Error creating logged-in user', ws['id_socket'],
|
|
2183
|
+
error_9 = _a.sent();
|
|
2184
|
+
console.error(new Date(), 'Error creating logged-in user', ws['id_socket'], error_9);
|
|
2092
2185
|
this.logConnectDebug('Create logged-in user failed', {
|
|
2093
2186
|
id_socket: ws['id_socket'],
|
|
2094
2187
|
id_user: ws['id_user'],
|
|
2095
2188
|
user: ws['user'],
|
|
2096
|
-
error: (
|
|
2189
|
+
error: (error_9 === null || error_9 === void 0 ? void 0 : error_9.message) || error_9
|
|
2097
2190
|
});
|
|
2098
2191
|
return [3 /*break*/, 3];
|
|
2099
2192
|
case 3: return [2 /*return*/];
|
|
@@ -2420,6 +2513,12 @@ var ResolveIOMainServer = /** @class */ (function () {
|
|
|
2420
2513
|
var raw = (_c = (_b = (_a = process.env.RESOLVEIO_STANDALONE_NODE_REAPER_DRY_RUN) !== null && _a !== void 0 ? _a : process.env.STANDALONE_NODE_REAPER_DRY_RUN) !== null && _b !== void 0 ? _b : config === null || config === void 0 ? void 0 : config['RESOLVEIO_STANDALONE_NODE_REAPER_DRY_RUN']) !== null && _c !== void 0 ? _c : config === null || config === void 0 ? void 0 : config['STANDALONE_NODE_REAPER_DRY_RUN'];
|
|
2421
2514
|
return this.parseDebugFlag(raw);
|
|
2422
2515
|
};
|
|
2516
|
+
ResolveIOMainServer.prototype.resolveStandaloneNodeReaperAlertWindowMs = function () {
|
|
2517
|
+
var _a, _b, _c;
|
|
2518
|
+
var config = resolveio_server_app_1.ResolveIOServer.getServerConfig ? resolveio_server_app_1.ResolveIOServer.getServerConfig() : null;
|
|
2519
|
+
var raw = (_c = (_b = (_a = process.env.RESOLVEIO_STANDALONE_NODE_REAPER_ALERT_WINDOW_MS) !== null && _a !== void 0 ? _a : process.env.STANDALONE_NODE_REAPER_ALERT_WINDOW_MS) !== null && _b !== void 0 ? _b : config === null || config === void 0 ? void 0 : config['RESOLVEIO_STANDALONE_NODE_REAPER_ALERT_WINDOW_MS']) !== null && _c !== void 0 ? _c : config === null || config === void 0 ? void 0 : config['STANDALONE_NODE_REAPER_ALERT_WINDOW_MS'];
|
|
2520
|
+
return this.parsePositiveInt(raw, this._standaloneNodeReaperAlertWindowMs);
|
|
2521
|
+
};
|
|
2423
2522
|
ResolveIOMainServer.prototype.isPm2ManagedRuntime = function () {
|
|
2424
2523
|
return Boolean(process.env.pm_id
|
|
2425
2524
|
|| process.env.PM2_HOME
|
|
@@ -3316,7 +3415,7 @@ var ResolveIOMainServer = /** @class */ (function () {
|
|
|
3316
3415
|
});
|
|
3317
3416
|
}
|
|
3318
3417
|
setTimeout(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
3319
|
-
var
|
|
3418
|
+
var error_10;
|
|
3320
3419
|
return __generator(this, function (_a) {
|
|
3321
3420
|
switch (_a.label) {
|
|
3322
3421
|
case 0:
|
|
@@ -3326,8 +3425,8 @@ var ResolveIOMainServer = /** @class */ (function () {
|
|
|
3326
3425
|
_a.sent();
|
|
3327
3426
|
return [3 /*break*/, 3];
|
|
3328
3427
|
case 2:
|
|
3329
|
-
|
|
3330
|
-
console.error(new Date(), 'AI execution run failed:',
|
|
3428
|
+
error_10 = _a.sent();
|
|
3429
|
+
console.error(new Date(), 'AI execution run failed:', error_10);
|
|
3331
3430
|
return [3 /*break*/, 3];
|
|
3332
3431
|
case 3: return [2 /*return*/];
|
|
3333
3432
|
}
|