From 61b16a068ac2bb4d8576d9a8aeb0f3f572587eed Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sat, 14 Nov 2020 20:26:29 +0300 Subject: chore: add logs to job events --- src/services/events/event.service.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/services') diff --git a/src/services/events/event.service.js b/src/services/events/event.service.js index accd45d..267016f 100644 --- a/src/services/events/event.service.js +++ b/src/services/events/event.service.js @@ -18,6 +18,12 @@ class Events { // Define jobs this.agenda.define('attend class', handleAttendClassJob); + + // Logs + this.agenda.on('start', job => console.log(`Starting ${job.attrs.name} job`)); + this.agenda.on('complete', job => console.log(`Job ${job.attrs.name} finished`)); + this.agenda.on('fail', (job, err) => console.log(`Job failed with the error ${err}`)); + return this.agenda.start(); }; -- cgit v1.2.3