Skip to content

Commit

Permalink
fix CommandLoad.h, get java/php/nodejs exe first
Browse files Browse the repository at this point in the history
  • Loading branch information
ruanshudong committed Apr 1, 2020
1 parent 164b34a commit 1d9b920
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions NodeServer/CommandLoad.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ inline int CommandLoad::execute(string& sResult)
//获取服务框架配置文件
_confPath = _serverDir + FILE_SEP + "conf" + FILE_SEP;
_confFile = _confPath + _desc.application + "." + _desc.serverName + ".config.conf";

//若exePath不合法采用默认路径
//注意java服务启动方式特殊 可执行文件为java 须特殊处理
if (_exePath.empty())
Expand All @@ -136,11 +137,14 @@ inline int CommandLoad::execute(string& sResult)
try
{
TC_Config conf;
conf.parseFile(_confFile);
conf.parseString(_desc.profile);

_exeFile = conf.get("/tars/application/server<java>", "java");
}
catch(exception &ex)
{
NODE_LOG("KeepAliveThread")->error() << "parse template error:" << ex.what() << endl;

_exeFile = "java";
}
}
Expand All @@ -149,11 +153,13 @@ inline int CommandLoad::execute(string& sResult)
try
{
TC_Config conf;
conf.parseFile(_confFile);
conf.parseFile(_desc.profile);
_exeFile = conf.get("/tars/application/server<nodejs>", "node");
}
catch(exception &ex)
{
NODE_LOG("KeepAliveThread")->error() << "parse template error:" << ex.what() << endl;

_exeFile = "node";
}
}
Expand All @@ -162,11 +168,13 @@ inline int CommandLoad::execute(string& sResult)
try
{
TC_Config conf;
conf.parseFile(_confFile);
conf.parseFile(_desc.profile);
_exeFile = conf.get("/tars/application/server<php>", "php");
}
catch(exception &ex)
{
NODE_LOG("KeepAliveThread")->error() << "parse template error:" << ex.what() << endl;

_exeFile = "php";
}
}
Expand Down

0 comments on commit 1d9b920

Please sign in to comment.