diff --git a/server/src/service/v1/infrastructure/SuperSimpleQueue/SuperSimpleQueue.js b/server/src/service/v1/infrastructure/SuperSimpleQueue/SuperSimpleQueue.js index ac1286e10..a3cdea8e7 100644 --- a/server/src/service/v1/infrastructure/SuperSimpleQueue/SuperSimpleQueue.js +++ b/server/src/service/v1/infrastructure/SuperSimpleQueue/SuperSimpleQueue.js @@ -35,9 +35,9 @@ class SuperSimpleQueue { this.scheduler.addTemplate("monitor-job", this.helper.getMonitorJob()); const monitors = await this.db.monitorModule.getAllMonitors(); for (const monitor of monitors) { - const randomOffset = Math.floor(Math.random() * monitor.interval); + const randomOffset = Math.floor(Math.random() * 100); setTimeout(() => { - this.addJob(monitor); + this.addJob(monitor._id, monitor); }, randomOffset); } diff --git a/server/src/service/v1/infrastructure/emailService.js b/server/src/service/v1/infrastructure/emailService.js index bc040d51a..ed661ff16 100755 --- a/server/src/service/v1/infrastructure/emailService.js +++ b/server/src/service/v1/infrastructure/emailService.js @@ -46,7 +46,7 @@ class EmailService { */ this.loadTemplate = (templateName) => { try { - const templatePath = this.path.join(__dirname, `../../templates/${templateName}.mjml`); + const templatePath = this.path.join(__dirname, `../../../templates/${templateName}.mjml`); const templateContent = this.fs.readFileSync(templatePath, "utf8"); return this.compile(templateContent); } catch (error) {