speed-limiter
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -32,10 +32,10 @@ const { Transform } = require('stream') | ||
while (slice.length) { | ||
// Stop pushing chunks if rate is zero | ||
while (this.group.getRate() === 0) { | ||
await wait(1 * 1000) // 1 second | ||
} | ||
try { | ||
// Check here again because we might be in the middle of a big chunk | ||
if (this.enabled && this.group.enabled) { | ||
// Stop pushing chunks if rate is zero | ||
while (this.group.getRate() === 0) { | ||
await wait(1 * 1000) // 1 second | ||
} | ||
await new Promise((resolve, reject) => { | ||
@@ -42,0 +42,0 @@ this.group.bucket.removeTokens(slice.length, (err) => { |
{ | ||
"name": "speed-limiter", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "Throttle the speed of streams", | ||
@@ -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
9307