mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-13 15:14:52 +09:00
Print version on startup
Help determining what is running by printing the version that is running on master and slave startup.
This commit is contained in:
1 parent
3d186a24ff
commit
351fcba4f8
2 files changed
+12
-6
No files matched your search
@@ -38,6 +38,7 @@ const libLoggingUtils = require("@clusterio/lib/logging_utils");
|
||||
|
||||
const Master = require("./src/Master");
|
||||
const UserManager = require("./src/UserManager");
|
||||
const version = require("./package").version;
|
||||
|
||||
// globals
|
||||
let master;
|
||||
@@ -284,6 +285,12 @@ async function initialize() {
|
||||
}));
|
||||
}
|
||||
|
||||
let command = parameters.args._[0];
|
||||
if (command === "run") {
|
||||
logger.info(`Starting Clusterio master ${version}`);
|
||||
parameters.shouldRun = true;
|
||||
}
|
||||
|
||||
logger.info(`Loading available plugins from ${parameters.args.pluginList}`);
|
||||
let pluginList = new Map();
|
||||
try {
|
||||
@@ -295,7 +302,6 @@ async function initialize() {
|
||||
}
|
||||
|
||||
// If the command is plugin management we don't try to load plugins
|
||||
let command = parameters.args._[0];
|
||||
if (command === "plugin") {
|
||||
await libSharedCommands.handlePluginCommand(parameters.args, pluginList, parameters.args.pluginList);
|
||||
return parameters;
|
||||
@@ -336,15 +342,11 @@ async function initialize() {
|
||||
await libSharedCommands.handleConfigCommand(
|
||||
parameters.args, parameters.masterConfig, parameters.masterConfigPath
|
||||
);
|
||||
return parameters;
|
||||
|
||||
} else if (command === "bootstrap") {
|
||||
await handleBootstrapCommand(parameters.args, parameters.masterConfig);
|
||||
return parameters;
|
||||
}
|
||||
|
||||
// If we get here the command was run
|
||||
parameters.shouldRun = true;
|
||||
return parameters;
|
||||
}
|
||||
|
||||
|
||||
@@ -129,6 +129,11 @@ async function startSlave() {
|
||||
}));
|
||||
}
|
||||
|
||||
let command = args._[0];
|
||||
if (command === "run") {
|
||||
logger.info(`Starting Clusterio slave ${version}`);
|
||||
}
|
||||
|
||||
// add better stack traces on promise rejection
|
||||
process.on("unhandledRejection", err => logger.error(`Unhandled rejection:\n${err.stack}`));
|
||||
|
||||
@@ -143,7 +148,6 @@ async function startSlave() {
|
||||
}
|
||||
|
||||
// If the command is plugin management we don't try to load plugins
|
||||
let command = args._[0];
|
||||
if (command === "plugin") {
|
||||
await libSharedCommands.handlePluginCommand(args, pluginList, args.pluginList);
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user