Small Bree based job runner + gui
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

timeline.service.js 824B

123456789101112131415161718192021222324252627282930313233343536
  1. const Schmervice = require('@hapipal/schmervice')
  2. const Bree = require('bree')
  3. const all = require('../jobs')
  4. module.exports = class Timeline extends Schmervice.Service {
  5. constructor(...args) {
  6. super(...args)
  7. this.bree = new Bree({ jobs: all.jobs })
  8. this.bree.start()
  9. }
  10. async start(jobName) {
  11. if (!jobName) {
  12. await this.bree.start()
  13. } else {
  14. await this.bree.start(jobName)
  15. }
  16. return this.bree
  17. }
  18. stop(jobName) {
  19. if (!jobName) {
  20. this.bree.stop()
  21. } else {
  22. this.bree.stop(jobName)
  23. }
  24. }
  25. async add(jobName) {
  26. if (!jobName) return
  27. await this.bree.add(jobName)
  28. }
  29. remove(jobName) {
  30. if (!jobName) return
  31. this.bree.remove(jobName)
  32. }
  33. }