-
Notifications
You must be signed in to change notification settings - Fork 0
/
mycat-startup.js
35 lines (29 loc) · 1.07 KB
/
mycat-startup.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
const SystemConfig = require('./config/model/system-config');
const MycatServer = require('./mycat-server');
const Logger = require('./util/logger');
const process = require('process');
const path = require('path');
class MycatStartup {
static main(argv) {
try {
const home = SystemConfig.homePath;
if (!home) {
Logger.error("%s is not set.", SystemConfig.SYS_HOME);
process.exit(-1);
}
const server = MycatServer.instance;
server.startup();
if (SystemConfig.logFileDisabled) {
Logger.log('MyCAT Server startup successfully. Logging file disabled.');
} else {
const logFile = path.resolve(home, "logs", "mycat.log");
Logger.log(`MyCAT Server startup successfully. See logs in '%s'.`, logFile);
}
} catch (e) {
MycatServer.uncaught('MyCAT Server startup error', e);
process.exit(-1);
}
}
}
const argv = process.argv;
MycatStartup.main(argv);