move listener registration to constructor

This commit is contained in:
Alex Holliday committed 2026-05-29 11:45:17 -07:00
1 parent 4629a947a4
commit c704f67e57
2 files changed
+2 -3

No files matched your search

@@ -25,6 +25,7 @@ export class LessSimpleQueue implements IJobQueue {
this.helper = helper;
this.monitorsRepository = monitorsRepository;
this.scheduler = scheduler;
this.registerListeners();
}
get serviceName() {
@@ -121,7 +122,6 @@ export class LessSimpleQueue implements IJobQueue {
init = async () => {
try {
this.registerListeners();
await this.scheduler.start();
this.scheduler.addTemplate("monitor-job", this.helper.getHeartbeatJob());
this.scheduler.addTemplate("geo-check-job", this.helper.getHeartbeatGeoJob());
@@ -69,6 +69,7 @@ export class SuperSimpleQueue implements ISuperSimpleQueue {
this.helper = helper;
this.monitorsRepository = monitorsRepository;
this.scheduler = scheduler;
this.registerListeners();
}
get serviceName() {
@@ -158,8 +159,6 @@ export class SuperSimpleQueue implements ISuperSimpleQueue {
init = async () => {
try {
this.registerListeners();
this.scheduler.start();
this.scheduler.addTemplate("monitor-job", this.helper.getHeartbeatJob());
this.scheduler.addTemplate("geo-check-job", this.helper.getHeartbeatGeoJob());