(name)
| 728 | } |
| 729 | |
| 730 | async remove(name) { |
| 731 | debug('remove', name); |
| 732 | |
| 733 | if (!this._init) await this.init(); |
| 734 | |
| 735 | const job = this.config.jobs.find((j) => j.name === name); |
| 736 | if (!job) { |
| 737 | throw new Error(`Job "${name}" does not exist`); |
| 738 | } |
| 739 | |
| 740 | // make sure it also closes any open workers |
| 741 | await this.stop(name); |
| 742 | |
| 743 | this.config.jobs = this.config.jobs.filter((j) => j.name !== name); |
| 744 | } |
| 745 | |
| 746 | /** |
| 747 | * A friendly helper to clear safe-timers timeout and interval |