exodus-framework 2.1.1039 → 2.1.1042
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/lib/services/database.js +1 -1
- package/lib/services/task/queue/QueueService.d.ts +1 -0
- package/lib/services/task/queue/QueueService.d.ts.map +1 -1
- package/lib/services/task/queue/QueueService.js +4 -2
- package/lib/services/task/scheduler/SchedulerService.d.ts +1 -1
- package/lib/services/task/scheduler/SchedulerService.d.ts.map +1 -1
- package/lib/services/task/scheduler/SchedulerService.js +2 -3
- package/package.json +1 -1
package/lib/services/database.js
CHANGED
@@ -261,6 +261,7 @@ class DatabaseService extends _app.Service {
|
|
261
261
|
}),
|
262
262
|
logger: console
|
263
263
|
});
|
264
|
+
await umzung.up();
|
264
265
|
if (downgrades.length > 0) {
|
265
266
|
this.log(`⚠️ Downgrade migrations: ${downgrades.join(', ')}`, 'warning');
|
266
267
|
try {
|
@@ -271,7 +272,6 @@ class DatabaseService extends _app.Service {
|
|
271
272
|
this.log(`⚠️ Error downgrading migrations: ${error.message}`, 'warning');
|
272
273
|
}
|
273
274
|
}
|
274
|
-
await umzung.up();
|
275
275
|
}
|
276
276
|
|
277
277
|
/**
|
@@ -4,6 +4,7 @@ import QueueTask from './QueueTask';
|
|
4
4
|
declare class QueueTaskService extends TaskServiceBase<typeof QueueTask<any>> {
|
5
5
|
private connection;
|
6
6
|
onStart(): Promise<boolean>;
|
7
|
+
onExodusStarted(): Promise<void>;
|
7
8
|
startTask(task: QueueTask<any>): Promise<void>;
|
8
9
|
getCacheConnection(): ConnectionOptions;
|
9
10
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"QueueService.d.ts","sourceRoot":"","sources":["../../../../src/services/task/queue/QueueService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAIhD,OAAO,eAAe,MAAM,oBAAoB,CAAC;AACjD,OAAO,SAAS,MAAM,aAAa,CAAC;AAGpC,cAAM,gBAAiB,SAAQ,eAAe,CAAC,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC;IACnE,OAAO,CAAC,UAAU,CAAoB;
|
1
|
+
{"version":3,"file":"QueueService.d.ts","sourceRoot":"","sources":["../../../../src/services/task/queue/QueueService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAIhD,OAAO,eAAe,MAAM,oBAAoB,CAAC;AACjD,OAAO,SAAS,MAAM,aAAa,CAAC;AAGpC,cAAM,gBAAiB,SAAQ,eAAe,CAAC,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC;IACnE,OAAO,CAAC,UAAU,CAAoB;IAEzB,OAAO;IAUP,eAAe;IAUf,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,GAAG,CAAC;IAwBpC,kBAAkB;CAG1B;AAED,eAAe,gBAAgB,CAAC"}
|
@@ -17,12 +17,14 @@ class QueueTaskService extends _TaskServiceBase.default {
|
|
17
17
|
port: Number(_app.Core.settings.getCache().port),
|
18
18
|
password: _app.Core.settings.getCache().password
|
19
19
|
};
|
20
|
+
return true;
|
21
|
+
}
|
22
|
+
async onExodusStarted() {
|
20
23
|
this.log('Initializing jobs', 'info');
|
21
24
|
for (const task of this.tasks) {
|
22
25
|
this.startTask(task.singleton());
|
23
26
|
}
|
24
|
-
this.log('All jobs
|
25
|
-
return true;
|
27
|
+
this.log('All jobs initialized', 'info');
|
26
28
|
}
|
27
29
|
async startTask(task) {
|
28
30
|
task.taskInit();
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import TaskServiceBase from '../TaskServiceBase';
|
2
2
|
import ScheduleTask from './SchedulerTask';
|
3
3
|
declare class SchedulerTaskService extends TaskServiceBase<typeof ScheduleTask> {
|
4
|
-
|
4
|
+
onExodusStarted(): Promise<void>;
|
5
5
|
private startTask;
|
6
6
|
}
|
7
7
|
export default SchedulerTaskService;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SchedulerService.d.ts","sourceRoot":"","sources":["../../../../src/services/task/scheduler/SchedulerService.ts"],"names":[],"mappings":"AAEA,OAAO,eAAe,MAAM,oBAAoB,CAAC;AACjD,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAE3C,cAAM,oBAAqB,SAAQ,eAAe,CAAC,OAAO,YAAY,CAAC;
|
1
|
+
{"version":3,"file":"SchedulerService.d.ts","sourceRoot":"","sources":["../../../../src/services/task/scheduler/SchedulerService.ts"],"names":[],"mappings":"AAEA,OAAO,eAAe,MAAM,oBAAoB,CAAC;AACjD,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAE3C,cAAM,oBAAqB,SAAQ,eAAe,CAAC,OAAO,YAAY,CAAC;IACxD,eAAe;YASd,SAAS;CAgBxB;AAED,eAAe,oBAAoB,CAAC"}
|
@@ -9,21 +9,20 @@ var _core = require("../../../contracts/core");
|
|
9
9
|
var _TaskServiceBase = _interopRequireDefault(require("../TaskServiceBase"));
|
10
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
11
11
|
class SchedulerTaskService extends _TaskServiceBase.default {
|
12
|
-
async
|
12
|
+
async onExodusStarted() {
|
13
13
|
this.log('Initializing taks...');
|
14
14
|
for (const task of this.tasks) {
|
15
15
|
const intanceTask = task.singleton();
|
16
16
|
this.startTask(intanceTask);
|
17
17
|
}
|
18
|
-
return true;
|
19
18
|
}
|
20
19
|
async startTask(task) {
|
21
20
|
await task.taskInit();
|
22
21
|
if (!task.getActive()) return;
|
23
22
|
if (task.getSide() === _core.eExecutionSide.ANY || task.getSide() === _core.eExecutionSide.CLUSTER && this.isCluster() || task.getSide() === _core.eExecutionSide.MASTER && this.isMaster()) {
|
24
|
-
if (task.isImmediate()) task.execute();
|
25
23
|
const job = (0, _nodeSchedule.scheduleJob)(task.getCronTask(), task.execute.bind(task));
|
26
24
|
task.setJob(job);
|
25
|
+
if (task.isImmediate()) task.execute();
|
27
26
|
}
|
28
27
|
this.log(`Job '${task.getName()}' started...`, 'warning');
|
29
28
|
}
|