diff options
author | eug-vs <eug-vs@keemail.me> | 2020-11-28 01:21:41 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-11-28 01:31:23 +0300 |
commit | c3b76d1b5d0f85deb9a52dbe516c665ab4de8c07 (patch) | |
tree | cfb7d6fae788ca16260199f6d52d40e45920f94b /src/services/events/event.model.js | |
parent | 2a1b70edbdef4ab934d0091a92c14327dde8a256 (diff) | |
download | bsu-fantom-c3b76d1b5d0f85deb9a52dbe516c665ab4de8c07.tar.gz |
fix: re-fetch event before running
Diffstat (limited to 'src/services/events/event.model.js')
-rw-r--r-- | src/services/events/event.model.js | 10 |
1 files changed, 0 insertions, 10 deletions
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(); |