()
| 46 | |
| 47 | // start automatically at boot |
| 48 | private async autoStart() { |
| 49 | await sleep(1000 * 5); |
| 50 | for (const instance of this.instances.values()) { |
| 51 | if (instance.config.eventTask.autoStart && instance.status() == Instance.STATUS_STOP) { |
| 52 | instance |
| 53 | .execPreset("start") |
| 54 | .then(() => { |
| 55 | logger.info( |
| 56 | $t("TXT_CODE_system_instance.autoStart", { |
| 57 | name: instance.config.nickname, |
| 58 | uuid: instance.instanceUuid |
| 59 | }) |
| 60 | ); |
| 61 | }) |
| 62 | .catch((reason) => { |
| 63 | logger.error( |
| 64 | $t("TXT_CODE_system_instance.autoStartErr", { |
| 65 | name: instance.config.nickname, |
| 66 | uuid: instance.instanceUuid, |
| 67 | reason: reason |
| 68 | }) |
| 69 | ); |
| 70 | }); |
| 71 | await sleep(1000 * 5); |
| 72 | } |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | // init all instances from local files |
| 77 | loadInstances() { |
no test coverage detected