Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jun 17, 2021. It is now read-only.
/SkyAPM-nodejsPublic archive

Commit88b4e48

Browse files
committed
fix(agent-options): Fix occurs exception when the serviceName is empty
1 parent1ee2a6b commit88b4e48

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

‎modules/nodejs-agent/lib/config/index.js‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,8 @@ AgentConfig.prototype.instanceUUID = function() {
6464
};
6565

6666
AgentConfig.prototype.initConfig=function(agentOptions){
67-
if(!agentOptions.hasOwnProperty("serviceName")){
68-
thrownewError("service name cannot be empty");
69-
}
70-
this._serviceName=agentOptions.serviceName||process.env.SW_SERVICE_NAME||"You Application";
71-
this._directServices=agentOptions.directServers||process.env.SW_DIRECT_SERVERS||"localhost:11800";
67+
this._serviceName=process.env.SW_SERVICE_NAME||(agentOptions&&agentOptions.serviceName)||"You Application";
68+
this._directServices=process.env.SW_DIRECT_SERVERS||(agentOptions&&agentOptions.directServers)||"localhost:11800";
7269
this._instanceUUID=agentOptions.instanceUUID||uuid();
7370
};
7471

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp