Skip to content

Commit 1d9b920

Browse files
committed
fix CommandLoad.h, get java/php/nodejs exe first
1 parent 164b34a commit 1d9b920

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

NodeServer/CommandLoad.h

+11-3
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ inline int CommandLoad::execute(string& sResult)
126126
//获取服务框架配置文件
127127
_confPath = _serverDir + FILE_SEP + "conf" + FILE_SEP;
128128
_confFile = _confPath + _desc.application + "." + _desc.serverName + ".config.conf";
129+
129130
//若exePath不合法采用默认路径
130131
//注意java服务启动方式特殊 可执行文件为java 须特殊处理
131132
if (_exePath.empty())
@@ -136,11 +137,14 @@ inline int CommandLoad::execute(string& sResult)
136137
try
137138
{
138139
TC_Config conf;
139-
conf.parseFile(_confFile);
140+
conf.parseString(_desc.profile);
141+
140142
_exeFile = conf.get("/tars/application/server<java>", "java");
141143
}
142144
catch(exception &ex)
143145
{
146+
NODE_LOG("KeepAliveThread")->error() << "parse template error:" << ex.what() << endl;
147+
144148
_exeFile = "java";
145149
}
146150
}
@@ -149,11 +153,13 @@ inline int CommandLoad::execute(string& sResult)
149153
try
150154
{
151155
TC_Config conf;
152-
conf.parseFile(_confFile);
156+
conf.parseFile(_desc.profile);
153157
_exeFile = conf.get("/tars/application/server<nodejs>", "node");
154158
}
155159
catch(exception &ex)
156160
{
161+
NODE_LOG("KeepAliveThread")->error() << "parse template error:" << ex.what() << endl;
162+
157163
_exeFile = "node";
158164
}
159165
}
@@ -162,11 +168,13 @@ inline int CommandLoad::execute(string& sResult)
162168
try
163169
{
164170
TC_Config conf;
165-
conf.parseFile(_confFile);
171+
conf.parseFile(_desc.profile);
166172
_exeFile = conf.get("/tars/application/server<php>", "php");
167173
}
168174
catch(exception &ex)
169175
{
176+
NODE_LOG("KeepAliveThread")->error() << "parse template error:" << ex.what() << endl;
177+
170178
_exeFile = "php";
171179
}
172180
}

0 commit comments

Comments
 (0)