@opuscapita/config
Advanced tools
Comparing version 3.0.7 to 3.0.8
@@ -39,3 +39,3 @@ const ConfigClientBase = require('./ConfigClientBase'); | ||
config : config, | ||
logger : config.logger || new Logger({ context : { serviceName : ConfigClientBase.serviceName } }), | ||
logger : config.logger || new Logger({ context : { serviceName : this.serviceName } }), | ||
cache : new Cache({ defaultExpire : Number.MAX_SAFE_INTEGER }) | ||
@@ -64,3 +64,3 @@ }; | ||
{ | ||
return `${ConfigClientBase.serviceName}/${key}`; | ||
return `${this.serviceName}/${key}`; | ||
} | ||
@@ -300,5 +300,5 @@ | ||
logger : null, | ||
serviceSecretPath : `/run/secrets/${ConfigClientBase.serviceName}-consul-key` | ||
serviceSecretPath : `/run/secrets/${this.serviceName}-consul-key` | ||
} | ||
module.exports = ConfigClient; |
@@ -29,3 +29,3 @@ const EventEmitter = require('events'); | ||
*/ | ||
static get serviceName() | ||
get serviceName() | ||
{ | ||
@@ -62,3 +62,3 @@ return serviceName; | ||
this._watchServices(consul, (allServices) => Promise.all(allServices.map((serviceName) => this._watchServiceHealth(consul, serviceName))).catch(e => this.logger.error(e))), | ||
this._watchKey(consul, ConfigClientBase.serviceName + '/') | ||
this._watchKey(consul, this.serviceName + '/') | ||
]); | ||
@@ -158,3 +158,3 @@ | ||
{ | ||
const cacheKey = ConfigClientBase.serviceName + '.ep.' + serviceName; | ||
const cacheKey = this.serviceName + '.ep.' + serviceName; | ||
@@ -234,3 +234,3 @@ if(this.watches[cacheKey]) | ||
const shortKey = key.substr(key.indexOf(ConfigClientBase.serviceName) + ConfigClientBase.serviceName.length + 1); | ||
const shortKey = key.substr(key.indexOf(this.serviceName) + this.serviceName.length + 1); | ||
@@ -255,3 +255,3 @@ /** | ||
{ | ||
const cacheName = ConfigClientBase.serviceName + '.ep.' + serviceName; | ||
const cacheName = this.serviceName + '.ep.' + serviceName; | ||
const results = await this.cache.get(cacheName); | ||
@@ -286,3 +286,3 @@ | ||
{ | ||
const key = keys[i].substr(keys[i].indexOf(ConfigClientBase.serviceName) + ConfigClientBase.serviceName.length + 1); | ||
const key = keys[i].substr(keys[i].indexOf(this.serviceName) + this.serviceName.length + 1); | ||
results[key] = values[i]; | ||
@@ -289,0 +289,0 @@ } |
{ | ||
"name": "@opuscapita/config", | ||
"version": "3.0.7", | ||
"version": "3.0.8", | ||
"description": "Configuration API connector module for OpusCapita Business Network Portal.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32225