exodus-framework 2.0.99999 → 2.1.0
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.
@@ -19,11 +19,11 @@ declare abstract class Managed extends System {
|
|
19
19
|
protected onClusterSIGTERM(_signal: NodeJS.Signals): void;
|
20
20
|
protected onMasterSIGTERM(_signal: NodeJS.Signals): void;
|
21
21
|
protected onUncaughtException(_err: Error): void;
|
22
|
-
protected onClusterUncaughtException(
|
23
|
-
protected onMasterUncaughtException(
|
22
|
+
protected onClusterUncaughtException(err: Error): void;
|
23
|
+
protected onMasterUncaughtException(err: Error): void;
|
24
24
|
protected onUnhandledRejection(_reason: unknown, _promise: Promise<unknown>): void;
|
25
|
-
protected onClusterUnhandledRejection(
|
26
|
-
protected onMasterUnhandledRejection(
|
25
|
+
protected onClusterUnhandledRejection(reason: unknown, promise: Promise<unknown>): void;
|
26
|
+
protected onMasterUnhandledRejection(reason: unknown, promise: Promise<unknown>): void;
|
27
27
|
protected isMaster(): boolean;
|
28
28
|
protected isCluster(): boolean;
|
29
29
|
protected getWorkers(): NodeJS.Dict<Worker>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"managed.d.ts","sourceRoot":"","sources":["../../../src/app/classes/managed.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAG1C,OAAO,MAAM,MAAM,UAAU,CAAC;
|
1
|
+
{"version":3,"file":"managed.d.ts","sourceRoot":"","sources":["../../../src/app/classes/managed.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAG1C,OAAO,MAAM,MAAM,UAAU,CAAC;AAU9B,uBAAe,OAAQ,SAAQ,MAAM;IACnC,OAAO,CAAC,SAAS,CAAU;IAC3B,OAAO,CAAC,UAAU,CAAU;;IAS5B,OAAO,CAAC,wBAAwB;IAWhC,SAAS,CAAC,MAAM;IAYhB,SAAS,CAAC,aAA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AO,CAAC"}
|
@@ -8,6 +8,7 @@ var _cluster = _interopRequireDefault(require("cluster"));
|
|
8
8
|
var _process = require("process");
|
9
9
|
var _event = _interopRequireDefault(require("./event"));
|
10
10
|
var _system = _interopRequireDefault(require("./system"));
|
11
|
+
var _utils = require("../../utils");
|
11
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
12
13
|
/**
|
13
14
|
* Disponibiliza ações de controle de clusters, incluindo comunicação básica
|
@@ -97,13 +98,19 @@ class Managed extends _system.default {
|
|
97
98
|
if (this.isMaster()) this.onMasterUncaughtException(_err);
|
98
99
|
if (this.isCluster()) this.onClusterUncaughtException(_err);
|
99
100
|
}
|
100
|
-
onClusterUncaughtException(
|
101
|
-
|
102
|
-
|
101
|
+
onClusterUncaughtException(err) {
|
102
|
+
const msg = `Uma excessão ocorreu no cluster: ${err.message}`;
|
103
|
+
this.log(msg, 'danger');
|
104
|
+
(0, _utils.logger)().fatal(err, msg);
|
105
|
+
|
106
|
+
// throw err;
|
103
107
|
}
|
104
|
-
onMasterUncaughtException(
|
105
|
-
|
106
|
-
|
108
|
+
onMasterUncaughtException(err) {
|
109
|
+
const msg = `Uma excessão ocorreu no master: ${err.message}`;
|
110
|
+
this.log(msg, 'danger');
|
111
|
+
(0, _utils.logger)().fatal(err, msg);
|
112
|
+
|
113
|
+
// throw err;
|
107
114
|
}
|
108
115
|
|
109
116
|
//# UNHANDLED REJECTION
|
@@ -111,13 +118,21 @@ class Managed extends _system.default {
|
|
111
118
|
if (this.isMaster()) this.onMasterUnhandledRejection(_reason, _promise);
|
112
119
|
if (this.isCluster()) this.onClusterUnhandledRejection(_reason, _promise);
|
113
120
|
}
|
114
|
-
onClusterUnhandledRejection(
|
115
|
-
|
116
|
-
(
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
+
onClusterUnhandledRejection(reason, promise) {
|
122
|
+
const msg = `Erro não tratado em uma promisse no cluster: ${reason}`;
|
123
|
+
this.log(msg, 'danger');
|
124
|
+
(0, _utils.logger)().fatal({
|
125
|
+
reason,
|
126
|
+
promise
|
127
|
+
}, msg);
|
128
|
+
}
|
129
|
+
onMasterUnhandledRejection(reason, promise) {
|
130
|
+
const msg = `Erro não tratado em uma promisse no master: ${reason}`;
|
131
|
+
this.log(msg, 'danger');
|
132
|
+
(0, _utils.logger)().fatal({
|
133
|
+
reason,
|
134
|
+
promise
|
135
|
+
}, msg);
|
121
136
|
}
|
122
137
|
|
123
138
|
//# Utils
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../src/services/database.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEnE,OAAO,EAAsB,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAgB,SAAS,EAAE,MAAM,WAAW,CAAC;AAKpD,cAAM,eAAgB,SAAQ,OAAO;IACnC,OAAO,CAAC,QAAQ,CAAgC;IAChD,OAAO,CAAC,WAAW,CAAyB;IAE/B,aAAa;IAWb,OAAO;IAkBP,WAAW;YAMV,cAAc;IA6Cf,gBAAgB,CAC3B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,OAAO;IAwBL,aAAa,CAAC,QAAQ,EAAE,MAAM;IAO9B,cAAc,CAAC,IAAI,EAAE;QAChC,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,OAAO,CAAC;KAClB;YA2Ba,sBAAsB;IA6BvB,YAAY;IAKZ,oBAAoB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;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,OAAO,CAAC;KAClB;YA2Ba,sBAAsB;IA6BvB,YAAY;IAKZ,oBAAoB,CAAC,QAAQ,EAAE,MAAM;YAMpC,UAAU;IASX,SAAS,CAAC,CAAC,SAAS,YAAY,CAAC,KAAK,CAAC,EAClD,KAAK,EAAE,kBAAkB,CAAC,CAAC,CAAC,EAC5B,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAU1B,OAAO,CAAC,qBAAqB;IAIhB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IA+BrC,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAmBrC,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAwBlC,sBAAsB,CAAC,UAAU,EAAE,SAAS;IAoB5C,mBAAmB,CAAC,UAAU,EAAE,SAAS;IAoBzC,mBAAmB;CAejC;AAED,eAAe,eAAe,CAAC"}
|
package/lib/services/database.js
CHANGED
@@ -246,7 +246,6 @@ class DatabaseService extends _app.Service {
|
|
246
246
|
*/
|
247
247
|
async migrateServiceEntities(connection) {
|
248
248
|
const migrations = _app.Core.settings.getDatabase().migrationsPath;
|
249
|
-
this.log(`Migrating service entities from path: ${migrations}`);
|
250
249
|
const umzung = new _umzug.Umzug({
|
251
250
|
migrations: {
|
252
251
|
glob: `${migrations}/*.js`
|
@@ -268,7 +267,6 @@ class DatabaseService extends _app.Service {
|
|
268
267
|
*/
|
269
268
|
async migrateCoreEntities(connection) {
|
270
269
|
const migrations = _path.default.resolve(__dirname, '../models/migrations');
|
271
|
-
this.log(`Migrating core entities from path: ${migrations}`);
|
272
270
|
const umzung = new _umzug.Umzug({
|
273
271
|
migrations: {
|
274
272
|
glob: `${migrations}/*.js`
|
@@ -289,7 +287,6 @@ class DatabaseService extends _app.Service {
|
|
289
287
|
*/
|
290
288
|
async migrateMainEntities() {
|
291
289
|
const path = `${_app.Core.settings.getDatabase().migrationsPath}/main`;
|
292
|
-
this.log(`Migrating main entities from path: ${path}`);
|
293
290
|
(0, _fs.mkdirSync)(path, {
|
294
291
|
recursive: true
|
295
292
|
});
|