From c3b76d1b5d0f85deb9a52dbe516c665ab4de8c07 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sat, 28 Nov 2020 01:21:41 +0300 Subject: fix: re-fetch event before running --- src/services/events/event.model.js | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'src/services/events/event.model.js') diff --git a/src/services/events/event.model.js b/src/services/events/event.model.js index 9ecacb7..56ba3c9 100644 --- a/src/services/events/event.model.js +++ b/src/services/events/event.model.js @@ -36,16 +36,6 @@ schema.methods.fail = function(error) { return this.save(); }; -schema.methods.run = async function(handler) { - try { - this.start(); - await handler(this); - return this.complete(); - } catch (error) { - this.fail(error); - } -}; - schema.methods.computeNextRunAt = function() { const job = new CronJob(this.schedule); const nextRunAt = job.nextDates(); -- cgit v1.2.3