@futdevpro/nts-dynamo 1.10.29 → 1.10.31
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/build/_models/control-models/app-params.control-model.d.ts +2 -0
- package/build/_models/control-models/app-params.control-model.d.ts.map +1 -1
- package/build/_models/control-models/app-params.control-model.js +2 -0
- package/build/_models/control-models/app-params.control-model.js.map +1 -1
- package/build/_modules/server/errors/errors.data-service.d.ts +9 -7
- package/build/_modules/server/errors/errors.data-service.d.ts.map +1 -1
- package/build/_modules/server/errors/errors.data-service.js +80 -46
- package/build/_modules/server/errors/errors.data-service.js.map +1 -1
- package/build/_modules/server/server-status/server-status.control-service.d.ts +1 -1
- package/build/_modules/server/server-status/server-status.control-service.d.ts.map +1 -1
- package/build/_modules/server/server-status/server-status.control-service.js.map +1 -1
- package/build/_services/base/data.service.d.ts +1 -1
- package/build/_services/base/data.service.d.ts.map +1 -1
- package/build/_services/base/data.service.js +4 -1
- package/build/_services/base/data.service.js.map +1 -1
- package/build/_services/server/app.server.d.ts.map +1 -1
- package/build/_services/server/app.server.js +2 -3
- package/build/_services/server/app.server.js.map +1 -1
- package/package.json +7 -6
- package/src/_models/control-models/app-params.control-model.ts +3 -0
- package/src/_modules/server/errors/errors.data-service.ts +120 -69
- package/src/_modules/server/server-status/server-status.control-service.ts +1 -1
- package/src/_services/base/data.service.ts +8 -2
- package/src/_services/server/app.server.ts +20 -12
|
@@ -22,8 +22,8 @@ import { DyNTS_DataService } from '../../../_services/base/data.service';
|
|
|
22
22
|
|
|
23
23
|
export class DyNTS_Errors_DataService<
|
|
24
24
|
T_Error extends DyFM_Error,
|
|
25
|
-
|
|
26
|
-
> extends DyNTS_DataService<
|
|
25
|
+
T_ErrorsRecord extends DyFM_Errors<T_Error>
|
|
26
|
+
> extends DyNTS_DataService<T_ErrorsRecord> implements DyNTS_Errors_ControlService<T_Error, T_ErrorsRecord> {
|
|
27
27
|
|
|
28
28
|
debugLog: boolean = false;
|
|
29
29
|
readonly version: string = DyNTS_global_settings.systemVersion;
|
|
@@ -43,7 +43,11 @@ export class DyNTS_Errors_DataService<
|
|
|
43
43
|
);
|
|
44
44
|
} */
|
|
45
45
|
|
|
46
|
-
async recordError(
|
|
46
|
+
async recordError(
|
|
47
|
+
errorsRecord: T_ErrorsRecord,
|
|
48
|
+
issuer: string,
|
|
49
|
+
alwaysRecord?: boolean
|
|
50
|
+
): Promise<void> {
|
|
47
51
|
try {
|
|
48
52
|
if (issuer && !this.issuer) {
|
|
49
53
|
this.issuer = issuer;
|
|
@@ -60,11 +64,11 @@ export class DyNTS_Errors_DataService<
|
|
|
60
64
|
return;
|
|
61
65
|
}
|
|
62
66
|
|
|
63
|
-
if (!
|
|
64
|
-
|
|
67
|
+
if (!errorsRecord && this.data) {
|
|
68
|
+
errorsRecord = this.data;
|
|
65
69
|
}
|
|
66
70
|
|
|
67
|
-
if (!
|
|
71
|
+
if (!errorsRecord) {
|
|
68
72
|
throw new DyFM_Error({
|
|
69
73
|
...this.getDefaultErrorSettings(
|
|
70
74
|
'recordError',
|
|
@@ -75,59 +79,59 @@ export class DyNTS_Errors_DataService<
|
|
|
75
79
|
});
|
|
76
80
|
}
|
|
77
81
|
|
|
78
|
-
if ([ DyFM_ErrorLevel.user ].includes(
|
|
82
|
+
if ([ DyFM_ErrorLevel.user ].includes(errorsRecord.level)) {
|
|
79
83
|
DyFM_Log.warn('error not saved (user level)');
|
|
80
84
|
|
|
81
85
|
return;
|
|
82
86
|
}
|
|
83
87
|
|
|
84
|
-
if (
|
|
85
|
-
|
|
88
|
+
if (errorsRecord.message?.includes('NullReferenceException')) {
|
|
89
|
+
errorsRecord.message += '\n' + errorsRecord.exception.split('() (at <')[0];
|
|
86
90
|
}
|
|
87
91
|
|
|
88
|
-
const duplicateError:
|
|
89
|
-
version:
|
|
90
|
-
message:
|
|
91
|
-
} as DyFM_DBFilter<
|
|
92
|
+
const duplicateError: T_ErrorsRecord = await this.findData({
|
|
93
|
+
version: errorsRecord.version,
|
|
94
|
+
message: errorsRecord.message,
|
|
95
|
+
} as DyFM_DBFilter<T_ErrorsRecord>, true);
|
|
92
96
|
|
|
93
|
-
|
|
97
|
+
errorsRecord.d_error = this.checkErrorIsStringifyableOrResolvable(errorsRecord.d_error, this.issuer) as T_Error;
|
|
94
98
|
|
|
95
99
|
try {
|
|
96
|
-
JSON.stringify(
|
|
100
|
+
JSON.stringify(errorsRecord);
|
|
97
101
|
} catch (err) {
|
|
98
102
|
DyFM_Log.error('error data is not stringifyable!');
|
|
99
103
|
|
|
100
104
|
return;
|
|
101
105
|
}
|
|
102
106
|
|
|
103
|
-
if (JSON.stringify(
|
|
104
|
-
|
|
107
|
+
if (JSON.stringify(errorsRecord).length > 16793000) {
|
|
108
|
+
errorsRecord.additionalContent = {
|
|
105
109
|
message: 'error data was too big to save, removed additionalContent',
|
|
106
110
|
};
|
|
107
|
-
|
|
111
|
+
errorsRecord.error.additionalContent = {
|
|
108
112
|
message: 'error data was too big to save, removed additionalContent',
|
|
109
113
|
};
|
|
110
114
|
|
|
111
|
-
if (JSON.stringify(
|
|
112
|
-
|
|
115
|
+
if (JSON.stringify(errorsRecord).length > 16793000) {
|
|
116
|
+
errorsRecord.error.errors = [];
|
|
113
117
|
}
|
|
114
118
|
}
|
|
115
119
|
|
|
116
120
|
if (
|
|
117
121
|
duplicateError &&
|
|
118
|
-
duplicateError?.message ===
|
|
122
|
+
duplicateError?.message === errorsRecord?.message
|
|
119
123
|
) {
|
|
120
|
-
if (!
|
|
121
|
-
|
|
124
|
+
if (!errorsRecord.__created) {
|
|
125
|
+
errorsRecord.__created = new Date();
|
|
122
126
|
}
|
|
123
127
|
|
|
124
128
|
this.duplicationCounter = duplicateError.count + 1;
|
|
125
129
|
|
|
126
130
|
await this.updateData({
|
|
127
|
-
filterBy: { _id: duplicateError._id } as DyFM_DBFilter<
|
|
131
|
+
filterBy: { _id: duplicateError._id } as DyFM_DBFilter<T_ErrorsRecord>,
|
|
128
132
|
update: {
|
|
129
|
-
$inc: { count: 1, priority: this.getPriorityMultiplierByLevel(
|
|
130
|
-
} as DyNTS_DBUpdate<
|
|
133
|
+
$inc: { count: 1, priority: this.getPriorityMultiplierByLevel(errorsRecord?.level) },
|
|
134
|
+
} as DyNTS_DBUpdate<T_ErrorsRecord>,
|
|
131
135
|
});
|
|
132
136
|
|
|
133
137
|
// ezt majd ha leülepedett, hogy biztos nem kellenek a deep duplication-ök
|
|
@@ -148,20 +152,20 @@ export class DyNTS_Errors_DataService<
|
|
|
148
152
|
'\ncount:', duplicateError.count + 1
|
|
149
153
|
);
|
|
150
154
|
DyFM_Log.error(
|
|
151
|
-
'ErrorMsg:',
|
|
155
|
+
'ErrorMsg:', errorsRecord?.message?.replace(/\n/g, ' \n')
|
|
152
156
|
);
|
|
153
157
|
|
|
154
|
-
if (this.debugLog) DyFM_Log.error('Error:',
|
|
158
|
+
if (this.debugLog) DyFM_Log.error('Error:', errorsRecord);
|
|
155
159
|
} else {
|
|
156
160
|
DyFM_Log.log('error not found, saving....');
|
|
157
161
|
DyFM_Log.error(
|
|
158
|
-
'ErrorMsg:',
|
|
162
|
+
'ErrorMsg:', errorsRecord?.message?.replace(/\n/g, ' \n')
|
|
159
163
|
);
|
|
160
164
|
|
|
161
|
-
if (this.debugLog) DyFM_Log.error('Error:',
|
|
165
|
+
if (this.debugLog) DyFM_Log.error('Error:', errorsRecord);
|
|
162
166
|
|
|
163
|
-
|
|
164
|
-
|
|
167
|
+
errorsRecord.priority = this.getPriorityMultiplierByLevel(errorsRecord?.level);
|
|
168
|
+
errorsRecord.duplications.push(DyFM_clone(errorsRecord));
|
|
165
169
|
|
|
166
170
|
this.duplicationCounter = 1;
|
|
167
171
|
|
|
@@ -185,20 +189,13 @@ export class DyNTS_Errors_DataService<
|
|
|
185
189
|
}
|
|
186
190
|
}
|
|
187
191
|
|
|
188
|
-
async
|
|
189
|
-
error: DyFM_AnyError | any,
|
|
192
|
+
protected async createErrorRecord(
|
|
193
|
+
error: DyFM_AnyError | any,
|
|
190
194
|
issuer: string,
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
try {
|
|
194
|
-
if (this.debugLog) DyFM_Log.log('handleInternalError');
|
|
195
|
-
|
|
196
|
-
if (issuer && !this.issuer) {
|
|
197
|
-
this.issuer = issuer;
|
|
198
|
-
}
|
|
199
|
-
|
|
195
|
+
): Promise<T_ErrorsRecord> {
|
|
196
|
+
try {
|
|
200
197
|
if ((error as DyFM_Error)?.flag?.includes(DyFM_errorFlag)) {
|
|
201
|
-
|
|
198
|
+
return new DyFM_Errors({
|
|
202
199
|
issuer: this.issuer,
|
|
203
200
|
version: 'SERVER-' + this.version,
|
|
204
201
|
|
|
@@ -215,9 +212,9 @@ export class DyNTS_Errors_DataService<
|
|
|
215
212
|
),
|
|
216
213
|
|
|
217
214
|
additionalContent: (error as DyFM_Error)?.additionalContent,
|
|
218
|
-
}) as
|
|
215
|
+
}) as T_ErrorsRecord;
|
|
219
216
|
} else {
|
|
220
|
-
|
|
217
|
+
return new DyFM_Errors({
|
|
221
218
|
issuer: this.issuer,
|
|
222
219
|
version: 'SERVER-' + this.version,
|
|
223
220
|
|
|
@@ -229,14 +226,58 @@ export class DyNTS_Errors_DataService<
|
|
|
229
226
|
|
|
230
227
|
message: (error as Error)?.message,
|
|
231
228
|
exceptionObj: (error as Error)?.stack?.split('\n'),
|
|
232
|
-
}) as
|
|
229
|
+
}) as T_ErrorsRecord;
|
|
233
230
|
}
|
|
231
|
+
} catch (error) {
|
|
232
|
+
throw new DyFM_Error({
|
|
233
|
+
...this.getDefaultErrorSettings('createErrorRecord', error),
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
async handleExternalError(
|
|
239
|
+
error: T_Error,
|
|
240
|
+
issuer: string,
|
|
241
|
+
alwaysRecord?: boolean,
|
|
242
|
+
): Promise<void> {
|
|
243
|
+
try {
|
|
244
|
+
if (this.debugLog) DyFM_Log.log('handleExternalError');
|
|
245
|
+
|
|
246
|
+
if (issuer && !this.issuer) {
|
|
247
|
+
this.issuer = issuer;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
const errorsRecord: T_ErrorsRecord = await this.createErrorRecord(error, this.issuer);
|
|
251
|
+
|
|
252
|
+
await this.recordError(errorsRecord, this.issuer, alwaysRecord);
|
|
253
|
+
} catch (error) {
|
|
254
|
+
throw new DyFM_Error({
|
|
255
|
+
...this.getDefaultErrorSettings('handleExternalError', error),
|
|
256
|
+
|
|
257
|
+
errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-EDS-HE0`,
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
async handleInternalError(
|
|
263
|
+
error: DyFM_AnyError | any,
|
|
264
|
+
issuer: string,
|
|
265
|
+
alwaysRecord?: boolean,
|
|
266
|
+
): Promise<void> {
|
|
267
|
+
try {
|
|
268
|
+
if (this.debugLog) DyFM_Log.log('handleInternalError');
|
|
269
|
+
|
|
270
|
+
if (issuer && !this.issuer) {
|
|
271
|
+
this.issuer = issuer;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
const errorsRecord: T_ErrorsRecord = await this.createErrorRecord(error, this.issuer);
|
|
234
275
|
|
|
235
276
|
/* if (!(error as FDP_Errors)?.flag?.includes('WB-ERROR-OBJECT')) {
|
|
236
277
|
DyFM_Log.H_error('__ERROR__:', error);
|
|
237
278
|
} */
|
|
238
279
|
|
|
239
|
-
await this.recordError(
|
|
280
|
+
await this.recordError(errorsRecord, this.issuer, alwaysRecord);
|
|
240
281
|
|
|
241
282
|
if (
|
|
242
283
|
DyNTS_global_settings.log_settings.highDetailedLogs ||
|
|
@@ -252,15 +293,11 @@ export class DyNTS_Errors_DataService<
|
|
|
252
293
|
);
|
|
253
294
|
}
|
|
254
295
|
} catch (error) {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
),
|
|
261
|
-
|
|
262
|
-
errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-EDS-HIE0`,
|
|
263
|
-
}); */
|
|
296
|
+
if (error instanceof DyFM_Error) {
|
|
297
|
+
error.logSimple('handleInternalError error');
|
|
298
|
+
} else {
|
|
299
|
+
DyFM_Log.error('handleInternalError error:', error);
|
|
300
|
+
}
|
|
264
301
|
}
|
|
265
302
|
}
|
|
266
303
|
|
|
@@ -272,7 +309,11 @@ export class DyNTS_Errors_DataService<
|
|
|
272
309
|
|
|
273
310
|
JSON.stringify(error);
|
|
274
311
|
} catch (err) {
|
|
275
|
-
|
|
312
|
+
if (err instanceof DyFM_Error) {
|
|
313
|
+
err.logSimple('checkErrorIsStringifyableOrResolvable error');
|
|
314
|
+
} else {
|
|
315
|
+
DyFM_Log.error('checkErrorIsStringifyableOrResolvable error:', err);
|
|
316
|
+
}
|
|
276
317
|
|
|
277
318
|
error = DyFM_Shared.resolveCirculation(error);
|
|
278
319
|
|
|
@@ -284,7 +325,11 @@ export class DyNTS_Errors_DataService<
|
|
|
284
325
|
try {
|
|
285
326
|
JSON.stringify(error);
|
|
286
327
|
} catch (err) {
|
|
287
|
-
|
|
328
|
+
if (err instanceof DyFM_Error) {
|
|
329
|
+
err.logSimple('error data is not stringifyable! resolution failed! will not save!');
|
|
330
|
+
} else {
|
|
331
|
+
DyFM_Log.error('error data is not stringifyable! resolution failed! will not save!', err);
|
|
332
|
+
}
|
|
288
333
|
|
|
289
334
|
return 'UNRESOLVABLE';
|
|
290
335
|
}
|
|
@@ -323,13 +368,13 @@ export class DyNTS_Errors_DataService<
|
|
|
323
368
|
async getErrorsFromDate(
|
|
324
369
|
date: Date,
|
|
325
370
|
issuer: string,
|
|
326
|
-
): Promise<DyFM_Paged<
|
|
371
|
+
): Promise<DyFM_Paged<T_ErrorsRecord>> {
|
|
327
372
|
try {
|
|
328
373
|
if (issuer && !this.issuer) {
|
|
329
374
|
this.issuer = issuer;
|
|
330
375
|
}
|
|
331
376
|
|
|
332
|
-
const errors:
|
|
377
|
+
const errors: T_ErrorsRecord[] = await this.findDataList({ __created: { $gte: date } });
|
|
333
378
|
|
|
334
379
|
return DyFM_Array.paged(errors, 0, 100);
|
|
335
380
|
} catch (error) {
|
|
@@ -354,6 +399,7 @@ export class DyNTS_Errors_DataService<
|
|
|
354
399
|
} catch (error) {
|
|
355
400
|
throw new DyFM_Error({
|
|
356
401
|
...this.getDefaultErrorSettings('deleteError', error),
|
|
402
|
+
|
|
357
403
|
errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-EDS-DE0`,
|
|
358
404
|
});
|
|
359
405
|
}
|
|
@@ -369,12 +415,13 @@ export class DyNTS_Errors_DataService<
|
|
|
369
415
|
} catch (error) {
|
|
370
416
|
throw new DyFM_Error({
|
|
371
417
|
...this.getDefaultErrorSettings('deleteAllErrors', error),
|
|
418
|
+
|
|
372
419
|
errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-EDS-DAE0`,
|
|
373
420
|
});
|
|
374
421
|
}
|
|
375
422
|
}
|
|
376
423
|
|
|
377
|
-
async getErrorsInRange(range: DyFM_RelativeDate, issuer: string): Promise<DyFM_Paged<
|
|
424
|
+
async getErrorsInRange(range: DyFM_RelativeDate, issuer: string): Promise<DyFM_Paged<T_ErrorsRecord>> {
|
|
378
425
|
try {
|
|
379
426
|
if (issuer && !this.issuer) {
|
|
380
427
|
this.issuer = issuer;
|
|
@@ -382,7 +429,7 @@ export class DyNTS_Errors_DataService<
|
|
|
382
429
|
|
|
383
430
|
const fromDate: Date = DyFM_Time.getDateByRelativeDate(range);
|
|
384
431
|
|
|
385
|
-
let errors:
|
|
432
|
+
let errors: T_ErrorsRecord[] = await this.findDataList({ __lastModified: { $gte: fromDate } });
|
|
386
433
|
errors = errors.sort(
|
|
387
434
|
(a, b): number => b.priority - a.priority
|
|
388
435
|
);
|
|
@@ -391,6 +438,7 @@ export class DyNTS_Errors_DataService<
|
|
|
391
438
|
} catch (error) {
|
|
392
439
|
throw new DyFM_Error({
|
|
393
440
|
...this.getDefaultErrorSettings('getErrorsInRange', error),
|
|
441
|
+
|
|
394
442
|
errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-EDS-GIR0`,
|
|
395
443
|
});
|
|
396
444
|
}
|
|
@@ -401,7 +449,7 @@ export class DyNTS_Errors_DataService<
|
|
|
401
449
|
pageSize: number,
|
|
402
450
|
pageIndex: number,
|
|
403
451
|
issuer: string,
|
|
404
|
-
): Promise<DyFM_Paged<
|
|
452
|
+
): Promise<DyFM_Paged<T_ErrorsRecord>> {
|
|
405
453
|
try {
|
|
406
454
|
if (issuer && !this.issuer) {
|
|
407
455
|
this.issuer = issuer;
|
|
@@ -409,7 +457,7 @@ export class DyNTS_Errors_DataService<
|
|
|
409
457
|
|
|
410
458
|
const fromDate: Date = DyFM_Time.getDateByRelativeDate(range);
|
|
411
459
|
|
|
412
|
-
let errors:
|
|
460
|
+
let errors: T_ErrorsRecord[] = await this.findDataList({ __lastModified: { $gte: fromDate } });
|
|
413
461
|
errors = errors.sort(
|
|
414
462
|
(a, b): number => b.priority - a.priority
|
|
415
463
|
);
|
|
@@ -418,6 +466,7 @@ export class DyNTS_Errors_DataService<
|
|
|
418
466
|
} catch (error) {
|
|
419
467
|
throw new DyFM_Error({
|
|
420
468
|
...this.getDefaultErrorSettings('getErrorsPaged', error),
|
|
469
|
+
|
|
421
470
|
errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-EDS-GIP0`,
|
|
422
471
|
});
|
|
423
472
|
}
|
|
@@ -428,7 +477,7 @@ export class DyNTS_Errors_DataService<
|
|
|
428
477
|
pageSize: number,
|
|
429
478
|
pageIndex: number,
|
|
430
479
|
issuer: string,
|
|
431
|
-
): Promise<DyFM_Paged<
|
|
480
|
+
): Promise<DyFM_Paged<T_ErrorsRecord>> {
|
|
432
481
|
try {
|
|
433
482
|
if (issuer && !this.issuer) {
|
|
434
483
|
this.issuer = issuer;
|
|
@@ -436,7 +485,7 @@ export class DyNTS_Errors_DataService<
|
|
|
436
485
|
|
|
437
486
|
const fromDate: Date = DyFM_Time.getDateByRelativeDate(range);
|
|
438
487
|
|
|
439
|
-
let errors:
|
|
488
|
+
let errors: T_ErrorsRecord[] = await this.findDataList({
|
|
440
489
|
__lastModified: { $gte: fromDate }
|
|
441
490
|
});
|
|
442
491
|
errors = errors.sort(
|
|
@@ -447,15 +496,16 @@ export class DyNTS_Errors_DataService<
|
|
|
447
496
|
} catch (error) {
|
|
448
497
|
throw new DyFM_Error({
|
|
449
498
|
...this.getDefaultErrorSettings('getLastErrors', error),
|
|
499
|
+
|
|
450
500
|
errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-EDS-GLE0`,
|
|
451
501
|
});
|
|
452
502
|
}
|
|
453
503
|
}
|
|
454
504
|
|
|
455
505
|
async searchErrors(
|
|
456
|
-
searchQuery: DyFM_SearchQuery<
|
|
506
|
+
searchQuery: DyFM_SearchQuery<T_ErrorsRecord>,
|
|
457
507
|
issuer: string,
|
|
458
|
-
): Promise<DyFM_SearchResult<
|
|
508
|
+
): Promise<DyFM_SearchResult<T_ErrorsRecord>> {
|
|
459
509
|
try {
|
|
460
510
|
if (issuer && !this.issuer) {
|
|
461
511
|
this.issuer = issuer;
|
|
@@ -465,6 +515,7 @@ export class DyNTS_Errors_DataService<
|
|
|
465
515
|
} catch (error) {
|
|
466
516
|
throw new DyFM_Error({
|
|
467
517
|
...this.getDefaultErrorSettings('searchErrors', error),
|
|
518
|
+
|
|
468
519
|
errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-EDS-SE0`,
|
|
469
520
|
});
|
|
470
521
|
}
|
|
@@ -229,7 +229,7 @@ export abstract class DyNTS_ServerStatus_ControlService<
|
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
-
|
|
232
|
+
protected async triggerCreateSnapshot(issuer: string): Promise<void> {
|
|
233
233
|
try {
|
|
234
234
|
const snapshot: T_ServerStatusSnapshot = await this.getServerStatusSnapshot(issuer);
|
|
235
235
|
const serverStatusSnapshot_CS: T_ServerStatusSnapshot_ControlService =
|
|
@@ -1902,14 +1902,20 @@ export class DyNTS_DataService<T extends DyFM_Metadata> {
|
|
|
1902
1902
|
keyIsUnique: dependencyParams.unique,
|
|
1903
1903
|
keyIsRequired: dependencyParams.required,
|
|
1904
1904
|
})));
|
|
1905
|
+
|
|
1906
|
+
if (this.depSettings.length === 1) {
|
|
1907
|
+
this.depDataDBService = DyNTS_GlobalService.getDBServiceByKey(
|
|
1908
|
+
this.depSettings[0].dbServiceKey
|
|
1909
|
+
);
|
|
1910
|
+
}
|
|
1905
1911
|
}
|
|
1906
1912
|
|
|
1907
1913
|
/**
|
|
1908
1914
|
*
|
|
1909
1915
|
* @returns
|
|
1910
1916
|
*/
|
|
1911
|
-
getDependencyDataDBService(dBServiceKey
|
|
1912
|
-
if (!dBServiceKey) {
|
|
1917
|
+
getDependencyDataDBService(dBServiceKey?: string): DyNTS_DBService<any> {
|
|
1918
|
+
if (!dBServiceKey && !this.depDataDBService) {
|
|
1913
1919
|
throw new DyFM_Error({
|
|
1914
1920
|
...this._getDefaultErrorSettings(
|
|
1915
1921
|
'getDependencyDataDBService',
|
|
@@ -490,7 +490,6 @@ export abstract class DyNTS_App extends DyNTS_SingletonService {
|
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
492
|
|
|
493
|
-
// eslint-disable-next-line max-lines-per-function
|
|
494
493
|
async ready(timeout: number = this.defaultReadyTimeout): Promise<void> {
|
|
495
494
|
try {
|
|
496
495
|
if (this.fnLogs) DyFM_Log.log('\nfn:. ready');
|
|
@@ -968,10 +967,14 @@ export abstract class DyNTS_App extends DyNTS_SingletonService {
|
|
|
968
967
|
await new Promise<void>((resolve, reject): void => {
|
|
969
968
|
this.systemControls.httpsServer.init = true;
|
|
970
969
|
this.httpsServer
|
|
971
|
-
.listen(
|
|
972
|
-
this.
|
|
973
|
-
|
|
974
|
-
|
|
970
|
+
.listen(
|
|
971
|
+
this._portSettings.httpsPort,
|
|
972
|
+
this.params.host,
|
|
973
|
+
this.params.expressBacklog,
|
|
974
|
+
(): void => {
|
|
975
|
+
this.systemControls.httpsServer.started = true;
|
|
976
|
+
DyFM_Log.success(
|
|
977
|
+
`\nHTTPS (secure) server is listening on port: ${this._portSettings.httpsPort}`
|
|
975
978
|
);
|
|
976
979
|
|
|
977
980
|
resolve();
|
|
@@ -1027,14 +1030,19 @@ export abstract class DyNTS_App extends DyNTS_SingletonService {
|
|
|
1027
1030
|
this.systemControls.httpServer.init = true;
|
|
1028
1031
|
await new Promise<void>((resolve, reject): void => {
|
|
1029
1032
|
this.httpServer = this.openExpress
|
|
1030
|
-
.listen(
|
|
1031
|
-
this.
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
)
|
|
1033
|
+
.listen(
|
|
1034
|
+
this._portSettings.httpPort,
|
|
1035
|
+
this.params.host,
|
|
1036
|
+
this.params.expressBacklog,
|
|
1037
|
+
(): void => {
|
|
1038
|
+
this.systemControls.httpServer.started = true;
|
|
1039
|
+
DyFM_Log.success(
|
|
1040
|
+
`\nHTTP (open) server is listening on port: ${this._portSettings.httpPort}`
|
|
1041
|
+
);
|
|
1035
1042
|
|
|
1036
|
-
|
|
1037
|
-
|
|
1043
|
+
resolve();
|
|
1044
|
+
}
|
|
1045
|
+
)
|
|
1038
1046
|
.on('error', (error): void => {
|
|
1039
1047
|
if (this.debugLog) DyFM_Log.error(`\nHTTP (open) server ERROR`, error);
|
|
1040
1048
|
|