Merge pull request #3689 from bluewave-labs/fix/listener-leak
fix: move listener registration to constructor
This commit is contained in:
2 files changed
+2
-3
No files matched your search
@@ -25,6 +25,7 @@ export class LessSimpleQueue implements IJobQueue {
|
|||||||
this.helper = helper;
|
this.helper = helper;
|
||||||
this.monitorsRepository = monitorsRepository;
|
this.monitorsRepository = monitorsRepository;
|
||||||
this.scheduler = scheduler;
|
this.scheduler = scheduler;
|
||||||
|
this.registerListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
get serviceName() {
|
get serviceName() {
|
||||||
@@ -121,7 +122,6 @@ export class LessSimpleQueue implements IJobQueue {
|
|||||||
|
|
||||||
init = async () => {
|
init = async () => {
|
||||||
try {
|
try {
|
||||||
this.registerListeners();
|
|
||||||
await this.scheduler.start();
|
await this.scheduler.start();
|
||||||
this.scheduler.addTemplate("monitor-job", this.helper.getHeartbeatJob());
|
this.scheduler.addTemplate("monitor-job", this.helper.getHeartbeatJob());
|
||||||
this.scheduler.addTemplate("geo-check-job", this.helper.getHeartbeatGeoJob());
|
this.scheduler.addTemplate("geo-check-job", this.helper.getHeartbeatGeoJob());
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ export class SuperSimpleQueue implements ISuperSimpleQueue {
|
|||||||
this.helper = helper;
|
this.helper = helper;
|
||||||
this.monitorsRepository = monitorsRepository;
|
this.monitorsRepository = monitorsRepository;
|
||||||
this.scheduler = scheduler;
|
this.scheduler = scheduler;
|
||||||
|
this.registerListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
get serviceName() {
|
get serviceName() {
|
||||||
@@ -158,8 +159,6 @@ export class SuperSimpleQueue implements ISuperSimpleQueue {
|
|||||||
|
|
||||||
init = async () => {
|
init = async () => {
|
||||||
try {
|
try {
|
||||||
this.registerListeners();
|
|
||||||
|
|
||||||
this.scheduler.start();
|
this.scheduler.start();
|
||||||
this.scheduler.addTemplate("monitor-job", this.helper.getHeartbeatJob());
|
this.scheduler.addTemplate("monitor-job", this.helper.getHeartbeatJob());
|
||||||
this.scheduler.addTemplate("geo-check-job", this.helper.getHeartbeatGeoJob());
|
this.scheduler.addTemplate("geo-check-job", this.helper.getHeartbeatGeoJob());
|
||||||
|
|||||||
Reference in new issue
Block a user