limitd-client
Advanced tools
Comparing version 2.1.4 to 2.1.5
@@ -9,3 +9,2 @@ const url = require('url'); | ||
const Protocol = require('limitd-protocol'); | ||
const uuid = require('uuid/v1'); | ||
@@ -77,2 +76,4 @@ const disyuntor = require('disyuntor'); | ||
this.resetCircuitBreaker = () => this._request.reset(); | ||
this.currentId = 0; | ||
} | ||
@@ -82,2 +83,12 @@ | ||
LimitdClient.prototype.nextId = function () { | ||
//start from 1 and conver to string because the protocol uses strings. | ||
if (this.currentId < Number.MAX_SAFE_INTEGER) { | ||
this.currentId++; | ||
} else { | ||
this.currentId = 1; | ||
} | ||
return (this.currentId).toString(); | ||
}; | ||
LimitdClient.prototype.connect = function (done) { | ||
@@ -240,3 +251,3 @@ var options = this._options; | ||
const request = { | ||
'id': uuid(), | ||
'id': this.nextId(), | ||
'type': type, | ||
@@ -278,3 +289,3 @@ 'key': key, | ||
const request = { | ||
'id': uuid(), | ||
'id': this.nextId(), | ||
'type': type, | ||
@@ -292,3 +303,3 @@ 'key': key, | ||
var request = { | ||
'id': uuid(), | ||
'id': this.nextId(), | ||
'type': type, | ||
@@ -304,3 +315,3 @@ 'key': key, | ||
var request = { | ||
'id': uuid(), | ||
'id': this.nextId(), | ||
'type': '', | ||
@@ -307,0 +318,0 @@ 'key': '', |
{ | ||
"name": "limitd-client", | ||
"version": "2.1.4", | ||
"version": "2.1.5", | ||
"description": "limitd client for node.js", | ||
@@ -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
34396
864