| 123456789101112131415161718192021222324252627282930313233343536 |
-
- const Schmervice = require('@hapipal/schmervice')
- const Bree = require('bree')
-
- const all = require('../jobs')
-
- module.exports = class Timeline extends Schmervice.Service {
- constructor(...args) {
- super(...args)
- this.bree = new Bree({ jobs: all.jobs })
- this.bree.start()
- }
- async start(jobName) {
- if (!jobName) {
- await this.bree.start()
- } else {
- await this.bree.start(jobName)
- }
- return this.bree
- }
- stop(jobName) {
- if (!jobName) {
- this.bree.stop()
- } else {
- this.bree.stop(jobName)
- }
- }
- async add(jobName) {
- if (!jobName) return
- await this.bree.add(jobName)
- }
- remove(jobName) {
- if (!jobName) return
- this.bree.remove(jobName)
- }
- }
|