(instance: Instance)
| 9 | private task: any = null; |
| 10 | |
| 11 | async start(instance: Instance) { |
| 12 | this.task = setInterval(async () => { |
| 13 | if (instance.config.endTime) { |
| 14 | const endTime = instance.config.endTime; |
| 15 | if (endTime) { |
| 16 | const currentTime = Date.now(); |
| 17 | if (endTime <= currentTime) { |
| 18 | // Expired, execute the end process command |
| 19 | await instance.execPreset("kill"); |
| 20 | clearInterval(this.task); |
| 21 | } |
| 22 | } |
| 23 | } |
| 24 | }, 1000 * 60 * 60); |
| 25 | } |
| 26 | |
| 27 | async stop(instance: Instance) { |
| 28 | clearInterval(this.task); |
nothing calls this directly
no test coverage detected