gitter-realtime-client
Advanced tools
Comparing version 0.3.10 to 0.3.11
@@ -98,2 +98,7 @@ "use strict"; | ||
/** | ||
* Only perform a sequence reset at most once every 5 minutes | ||
*/ | ||
var MIN_PERIOD_BETWEEN_RESETS = 300 * 1000; | ||
SequenceGapDetectorExtension.prototype = { | ||
@@ -103,2 +108,10 @@ incoming: function(message, callback) { | ||
var channel = message.channel; | ||
if (this.lastResetTime) { | ||
var timeSinceLastReset = Date.now() - this.lastResetTime; | ||
if (timeSinceLastReset < MIN_PERIOD_BETWEEN_RESETS) { | ||
return callback(message); | ||
} | ||
} | ||
if(c && channel && channel.indexOf('/meta') !== 0) { | ||
@@ -119,2 +132,4 @@ if (c === 1) { | ||
delete this._seqStarted; | ||
delete this._seq; | ||
this.lastResetTime = Date.now(); | ||
@@ -121,0 +136,0 @@ // Reset the connection |
{ | ||
"name": "gitter-realtime-client", | ||
"version": "0.3.10", | ||
"version": "0.3.11", | ||
"description": "Gitter Realtime Client", | ||
@@ -5,0 +5,0 @@ "main": "lib/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
63185
1528