diff options
-rw-r--r-- | src/handlers/index.js | 1 | ||||
-rw-r--r-- | src/services/events/event.service.js | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/handlers/index.js b/src/handlers/index.js index 18946fc..196c3db 100644 --- a/src/handlers/index.js +++ b/src/handlers/index.js @@ -35,7 +35,6 @@ const handleJobAsUser = async (job, user) => { }; const handleJob = async job => { - console.log('Running attend class job'); const { data } = job.attrs; const participants = await UserModel.find({ 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(); }; |