Skip to content

Commit

Permalink
add stress host setting
Browse files Browse the repository at this point in the history
  • Loading branch information
brookshi committed Jun 15, 2018
1 parent 7984864 commit bb292c9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/utils/setting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ export class Setting {
}

get stressHost() {
let host = this.appHost.replace(/^http(s?):\/\//g, 'ws://');
let host = process.env.HITCHHIKER_STRESS_HOST || this._setting.stress.stressHost;
host = host || this.appHost.replace(/^http(s?):\/\//g, 'ws://');
if (/:\d+/.test(host)) {
host = host.replace(/:\d+/, `:${this.stressPort}`);
} else {
Expand Down
1 change: 1 addition & 0 deletions appconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"stress": {
"type": "node",
"storeMaxCount": 5,
"stressHost": "",
"stressPort": 11010,
"stressUpdateInterval": 1000
},
Expand Down

0 comments on commit bb292c9

Please sign in to comment.