Comparing version 1.3.55 to 1.3.56
module.exports = { | ||
idLength: 16, | ||
reporterInterval: 2000, | ||
keeperInterval: 3000, | ||
reponseTolerance: 10000, | ||
reporterInterval: 5000, | ||
keeperInterval: 15000, | ||
reponseTolerance: 5000, | ||
maxReconnectAttempts: -1, | ||
@@ -9,0 +10,0 @@ reconnectTimeWait: 250, |
@@ -50,6 +50,7 @@ let NATS = require('nats') | ||
_randomNodeID ( entity ) { | ||
if ( !this.presences || !this.presences[ entity ] ) | ||
return null | ||
if ( !this.presences || !this.presences[ entity ] ) throw BaseErrors.NoSuchEntity( { entity } ) | ||
let ids = Object.keys( this.presences[ entity ] ) | ||
if ( ids.length === 0 ) throw BaseErrors.NoSuchEntity( { entity } ) | ||
let id = ids[ Math.floor( Math.random( ) * ids.length ) ] | ||
@@ -89,2 +90,7 @@ return id | ||
if ( self.presences[ present.entity ][ present.nodeID ] ) { | ||
self.presences[ present.entity ][ present.nodeID ].timestamp = Date.now() | ||
return OK | ||
} | ||
self.presences[ present.entity ][ present.nodeID ] = { | ||
@@ -347,3 +353,4 @@ timestamp: Date.now(), projectVersion: present.projectVersion, entityVersion: present.entityVersion | ||
nodeID: self.nodeID, | ||
entityVersion: entity.version | ||
entityVersion: entity.version, | ||
projectVersion: VERSION | ||
} | ||
@@ -350,0 +357,0 @@ self.natsServer.publish( SERVICES_REPORTS, self.strict ? JSON.stringify( await CommPresencer.derive( report ) ) : JSON.stringify( report ) ) |
@@ -23,4 +23,5 @@ let { newQuanstructor, VALIDATION_STR, VALIDATION_NUM, VALIDATION_BOOL, VALIDATION_OBJ } = require('./Devise') | ||
reporterInterval: { default: 5000, validation: VALIDATION_NUM }, | ||
keeperInterval: { default: 8000, validation: VALIDATION_NUM }, | ||
keeperInterval: { default: 15000, validation: VALIDATION_NUM }, | ||
maxReconnectAttempts: { default: -1, validation: VALIDATION_NUM }, | ||
@@ -27,0 +28,0 @@ reconnectTimeWait: { default: 250, validation: VALIDATION_NUM }, |
{ | ||
"name": "darcon", | ||
"version": "1.3.55", | ||
"version": "1.3.56", | ||
"description": "Simple Messaging/Service Bus for node entities over NatsIO", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
65292
1553