Socket
Socket
Sign inDemoInstall

@opuscapita/config

Package Overview
Dependencies
Maintainers
29
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opuscapita/config - npm Package Compare versions

Comparing version 3.0.18 to 3.0.20

29

lib/ConfigClientBase.js

@@ -63,3 +63,3 @@ const EventEmitter = require('events');

await Promise.all([
this._watchServices(consul, (allServices) => Promise.all(allServices.map((serviceName) => this._watchServiceHealth(consul, serviceName))).catch(e => this.logger.error(e))),
//this._watchServices(consul, (allServices) => Promise.all(allServices.map((serviceName) => this._watchServiceHealth(consul, serviceName))).catch(e => this.logger.error(e))),
this._watchKey(consul, this.serviceName + '/')

@@ -82,5 +82,12 @@ ]);

for(const k in this.epWatches)
{
this.epWatches[k].removeAllListeners('change').removeAllListeners('error');
this.epWatches[k].end();
}
for(const k in this.keyWatches)
{
this.keyWatches[k].removeAllListeners('change').removeAllListeners('error');
this.keyWatches[k].end();
}

@@ -147,3 +154,3 @@ this.epWatches = { };

watch.on('change', (data, res) => callback(Object.keys(data)));
watch.on('error', (err) => reject(err));
watch.once('error', (err) => reject(err));

@@ -173,3 +180,3 @@ resolve(watch);

watch.on('error', (err) => reject(err));
watch.once('error', (err) => reject(err));
watch.on('change', async (items) =>

@@ -213,4 +220,4 @@ {

{
// if(this.keyWatches[key])
// return resolve(this.keyWatches[key]);
if(this.keyWatches[key])
return resolve(this.keyWatches[key]);

@@ -221,3 +228,3 @@ const watch = consul.watch({ method : consul.kv.keys, options : { key : key } });

watch.on('error', (err) => reject(err));
watch.once('error', (err) => reject(err));
watch.on('change', (keys) =>

@@ -230,7 +237,8 @@ {

{
// if(this.keyWatches[key])
// this.keyWatches[key].end();
if(this.keyWatches[key])
this.keyWatches[key].end();
delete this.keyWatches[key];
delete this.knownKeys[key];
await this.cache.delete(key);

@@ -241,4 +249,5 @@

this.emit('propertyChanged', shortKey);
}));
})).catch(e => null);
Promise.all(keys.map(async (key) =>

@@ -268,3 +277,3 @@ {

}
}));
})).catch(e => null);
});

@@ -271,0 +280,0 @@

{
"name": "@opuscapita/config",
"version": "3.0.18",
"version": "3.0.20",
"description": "Configuration API connector module for OpusCapita Business Network Portal.",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc