MCPcopy Create free account
hub / github.com/MCSManager/MCSManager / autoStart

Method autoStart

daemon/src/service/system_instance.ts:48–74  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers 1

loadInstancesMethod · 0.95

Calls 6

sleepFunction · 0.90
$tFunction · 0.90
infoMethod · 0.80
errorMethod · 0.80
statusMethod · 0.65
execPresetMethod · 0.45

Tested by

no test coverage detected