Skip to content

Commit d01164e

Browse files
authored
Fix for issue #77 (#91)
Fix #77 - Change COHERENCE_GRPC_PROXY_ADDRESS env to match Python and Golang
1 parent d3b4baf commit d01164e

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ let session = new Session(opts)
127127
```
128128

129129
It's also possible to control the default address the session will bind to by providing
130-
an address via the `COHERENCE_GRPC_PROXY_ADDRESS` environment variable. The format of the value would
130+
an address via the `COHERENCE_SERVER_ADDRESS` environment variable. The format of the value would
131131
be the same as if you configured it programmatically as the above example shows.
132132

133133
Once the session has been constructed, it will now be possible to create maps and caches.

src/session.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,16 @@ export class Options {
260260
* Construct a new {@link Options}.
261261
*/
262262
constructor () {
263-
this._address = (process.env.grpc_proxy_address || process.env.COHERENCE_GRPC_PROXY_ADDRESS)
263+
this._address = (process.env.grpc_proxy_address ||
264+
process.env.COHERENCE_GRPC_PROXY_ADDRESS ||
265+
process.env.COHERENCE_SERVER_ADDRESS)
264266
|| Session.DEFAULT_ADDRESS
265267

268+
if (process.env.COHERENCE_GRPC_PROXY_ADDRESS !== undefined) {
269+
console.warn("The COHERENCE_GRPC_PROXY_ADDRESS environment variable"
270+
+ " is deprecated. Please use COHERENCE_SERVER_ADDRESS instead.")
271+
}
272+
266273
this._requestTimeoutInMillis = Session.DEFAULT_REQUEST_TIMEOUT
267274
this._readyTimeoutInMillis = Session.DEFAULT_READY_TIMEOUT
268275
this._format = Session.DEFAULT_FORMAT

0 commit comments

Comments
 (0)