mirror of
https://github.com/MCSManager/MCSManager.git
synced 2025-03-25 16:50:22 +08:00
This commit is contained in:
parent
e61f5b3a6e
commit
176c8ad02e
@ -12,7 +12,6 @@ import InstanceConfig from "../entity/instance/Instance_config";
|
||||
import { QueryMapWrapper, InstanceStreamListener } from "common";
|
||||
import FunctionDispatcher from "../entity/commands/dispatcher";
|
||||
import InstanceControl from "./system_instance_control";
|
||||
import StartCommand from "../entity/commands/start";
|
||||
import { globalConfiguration } from "../entity/config";
|
||||
|
||||
// init instance default install path
|
||||
@ -43,25 +42,27 @@ class InstanceSubsystem extends EventEmitter {
|
||||
private autoStart() {
|
||||
this.instances.forEach((instance) => {
|
||||
if (instance.config.eventTask.autoStart) {
|
||||
instance
|
||||
.execPreset("start")
|
||||
.then(() => {
|
||||
logger.info(
|
||||
$t("TXT_CODE_system_instance.autoStart", {
|
||||
name: instance.config.nickname,
|
||||
uuid: instance.instanceUuid
|
||||
})
|
||||
);
|
||||
})
|
||||
.catch((reason) => {
|
||||
logger.error(
|
||||
$t("TXT_CODE_system_instance.autoStartErr", {
|
||||
name: instance.config.nickname,
|
||||
uuid: instance.instanceUuid,
|
||||
reason: reason
|
||||
})
|
||||
);
|
||||
});
|
||||
setTimeout(() => {
|
||||
instance
|
||||
.execPreset("start")
|
||||
.then(() => {
|
||||
logger.info(
|
||||
$t("TXT_CODE_system_instance.autoStart", {
|
||||
name: instance.config.nickname,
|
||||
uuid: instance.instanceUuid
|
||||
})
|
||||
);
|
||||
})
|
||||
.catch((reason) => {
|
||||
logger.error(
|
||||
$t("TXT_CODE_system_instance.autoStartErr", {
|
||||
name: instance.config.nickname,
|
||||
uuid: instance.instanceUuid,
|
||||
reason: reason
|
||||
})
|
||||
);
|
||||
});
|
||||
}, 1000 * 10);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -107,7 +108,6 @@ class InstanceSubsystem extends EventEmitter {
|
||||
this.GLOBAL_INSTANCE_UUID
|
||||
);
|
||||
|
||||
// handle autostart
|
||||
this.autoStart();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user