exodus-framework 2.0.814 → 2.0.816
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/task/queue/QueueTask.d.ts +1 -0
- package/lib/services/task/queue/QueueTask.d.ts.map +1 -1
- package/lib/services/task/queue/QueueTask.js +4 -1
- package/lib/services/task/scheduler/SchedulerService.d.ts +1 -3
- package/lib/services/task/scheduler/SchedulerService.d.ts.map +1 -1
- package/lib/services/task/scheduler/SchedulerService.js +1 -1
- package/lib/services/task/scheduler/SchedulerTask.js +2 -1
- package/package.json +1 -1
@@ -13,6 +13,7 @@ declare abstract class QueueTask<DataType, ResultType = any, NameType extends st
|
|
13
13
|
execute(job: Job<DataType, ResultType, NameType>, token: string): void;
|
14
14
|
protected sendToServiceCluster(clusterId: number, event: string, data: DataType): void;
|
15
15
|
protected sendToServiceMaster(event: string, data: DataType): void;
|
16
|
+
static addJob<DataType>(data: DataType): Promise<void>;
|
16
17
|
onTaskInit(): Promise<void> | void;
|
17
18
|
onTaskClusterInit(): Promise<void> | void;
|
18
19
|
onTaskMasterInit(): Promise<void> | void;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"QueueTask.d.ts","sourceRoot":"","sources":["../../../../src/services/task/queue/QueueTask.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAAgB,SAAS,EAAE,MAAM,cAAc,CAAC;AAGvD,uBAAe,SAAS,CACtB,QAAQ,EACR,UAAU,GAAG,GAAG,EAChB,QAAQ,SAAS,MAAM,GAAG,MAAM,CAChC,SAAQ,SAAS;IACjB,OAAO,CAAC,kBAAkB,CAA2B;IACrD,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC;IACvB,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;IAEZ,MAAM,CAAC,IAAI,EAAE,QAAQ;IAa3B,QAAQ;IAGR,Q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,EAAE,IAAI,EAAE,QAAQ;WAGvC,MAAM,CAAC,QAAQ,EAAE,IAAI,EAAE,QAAQ;IAK5C,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAGlC,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAGzC,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAI/C,SAAS,CAAC,uBAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ;IAGrF,SAAS,CAAC,wBAAwB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ;IAI9D,gBAAgB,CACrB,IAAI,EAAE,GAAG,CAAC,QAAQ,EAAE,UAAU,EAAE,QAAQ,CAAC,EACzC,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAGhB,eAAe,CACpB,IAAI,EAAE,GAAG,CAAC,QAAQ,EAAE,UAAU,EAAE,QAAQ,CAAC,EACzC,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAGhB,SAAS,CACd,IAAI,EAAE,GAAG,CAAC,QAAQ,EAAE,UAAU,EAAE,QAAQ,CAAC,EACzC,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAIhB,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAG/C,SAAS,IAAI,OAAO;IAI3B,QAAQ,CAAC,OAAO,IAAI,MAAM;CAC3B;AACD,eAAe,SAAS,CAAC"}
|
@@ -21,7 +21,7 @@ class QueueTask extends _app.Singleton {
|
|
21
21
|
}
|
22
22
|
await this.queue.add(this.getName(), data);
|
23
23
|
this.onNewJob(data);
|
24
|
-
this.log('Nova tarefa disponível.', 'comment');
|
24
|
+
// this.log('Nova tarefa disponível.', 'comment');
|
25
25
|
}
|
26
26
|
getQueue() {
|
27
27
|
return this.queue;
|
@@ -60,6 +60,9 @@ class QueueTask extends _app.Singleton {
|
|
60
60
|
sendToServiceMaster(event, data) {
|
61
61
|
this.eventCommunication.sendMessageToMaster(event, data);
|
62
62
|
}
|
63
|
+
static async addJob(data) {
|
64
|
+
this.singleton().addJob(data);
|
65
|
+
}
|
63
66
|
|
64
67
|
//# Muted Methods
|
65
68
|
onTaskInit() {
|
@@ -1,8 +1,6 @@
|
|
1
1
|
import TaskServiceBase from '../TaskServiceBase';
|
2
2
|
import ScheduleTask from './SchedulerTask';
|
3
|
-
declare class SchedulerTaskService extends TaskServiceBase<ScheduleTask
|
4
|
-
new (): ScheduleTask;
|
5
|
-
}> {
|
3
|
+
declare class SchedulerTaskService extends TaskServiceBase<typeof ScheduleTask> {
|
6
4
|
private jobsPath;
|
7
5
|
onServiceInit(): Promise<void>;
|
8
6
|
private importAllJobs;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SchedulerService.d.ts","sourceRoot":"","sources":["../../../../src/services/task/scheduler/SchedulerService.ts"],"names":[],"mappings":"AAGA,OAAO,eAAe,MAAM,oBAAoB,CAAC;AACjD,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAE3C,cAAM,oBAAqB,SAAQ,eAAe,CAAC,
|
1
|
+
{"version":3,"file":"SchedulerService.d.ts","sourceRoot":"","sources":["../../../../src/services/task/scheduler/SchedulerService.ts"],"names":[],"mappings":"AAGA,OAAO,eAAe,MAAM,oBAAoB,CAAC;AACjD,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAE3C,cAAM,oBAAqB,SAAQ,eAAe,CAAC,OAAO,YAAY,CAAC;IACrE,OAAO,CAAC,QAAQ,CAAM;IAEhB,aAAa;YAaL,aAAa;YAcb,cAAc;CAS7B;AAED,eAAe,oBAAoB,CAAC"}
|
@@ -40,7 +40,7 @@ class SchedulerTaskService extends _TaskServiceBase.default {
|
|
40
40
|
}
|
41
41
|
async processAllJobs() {
|
42
42
|
for (const task of this.tasks) {
|
43
|
-
const intanceTask =
|
43
|
+
const intanceTask = task.singleton();
|
44
44
|
if (!intanceTask.getActive()) continue;
|
45
45
|
intanceTask.taskInit();
|
46
46
|
(0, _nodeSchedule.scheduleJob)(intanceTask.getCronTask(), intanceTask.execute.bind(intanceTask));
|
@@ -153,7 +153,8 @@ class ScheduleTask extends _app.Singleton {
|
|
153
153
|
}
|
154
154
|
taskClusterRegistered(_worker) {
|
155
155
|
if (!this.registeredClusters.has(_worker.id)) {
|
156
|
-
console.log('registrando novo cluster', _worker.id);
|
156
|
+
// console.log('registrando novo cluster', _worker.id);
|
157
|
+
|
157
158
|
this.registeredClusters.set(_worker.id, true);
|
158
159
|
}
|
159
160
|
this.onTaskClusterRegistered(_worker);
|