Skip to content

Commit

Permalink
tarsnode add nodename to template
Browse files Browse the repository at this point in the history
  • Loading branch information
ruanshudong committed Nov 12, 2023
1 parent d5d88bd commit 447a8a7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions NodeServer/CommandLoad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ int CommandLoad::updateConfigFile(string& sResult)
mMacro["modulename"] = _desc.application + "." + _desc.serverName;
mMacro["app"] = _desc.application;
mMacro["server"] = _desc.serverName;
mMacro["nodename"] = PlatformInfo().getNodeName();
mMacro["serverid"] = _serverObjectPtr->getServerId();
mMacro["localip"] = g_app.getAdapterEndpoint("ServerAdapter").getHost();
mMacro["exe"] = TC_File::simplifyDirectory(_exeFile);
Expand Down
2 changes: 1 addition & 1 deletion NodeServer/NodeServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ int NodeServer::onUpdateConfig(const string &nodeId, const string &sConfigFile,
sTemplate = TC_Common::replace(sTemplate, "${logpath}", config.get("/tars/application/server<logpath>", "tars"));
sTemplate = TC_Common::replace(sTemplate, "${localip}",sLocalIp);
sTemplate = TC_Common::replace(sTemplate, "${local}", config.get("/tars/application/server<local>", ""));
sTemplate = TC_Common::replace(sTemplate, "${modulename}", "tars.tarsnode");
sTemplate = TC_Common::replace(sTemplate, "${nodename}", config.get("/tars/application/server<nodename>", ""));

// cout << TC_Common::outfill("", '-') << endl;

Expand Down
2 changes: 2 additions & 0 deletions deploy/framework/sql/template/tars.default
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
app = ${app}
#server name
server = ${server}
#node name
nodename = ${nodename}
#local ip
localip = ${localip}
#local endpoint, for tars-node comunication(optional)
Expand Down
2 changes: 1 addition & 1 deletion tarscpp

0 comments on commit 447a8a7

Please sign in to comment.