Comparing version 4.28.1 to 4.28.2
@@ -45,2 +45,6 @@ "use strict"; | ||
const callbacks = pipeline[exports.kCallbacks]; | ||
// Stop keeping a reference to callbacks immediately after the callbacks stop being used. | ||
// This allows the GC to reclaim objects referenced by callbacks, especially with 16384 slots | ||
// in Redis.Cluster | ||
pipeline[exports.kCallbacks] = null; | ||
// Perform the call | ||
@@ -143,3 +147,3 @@ pipeline.exec(function (err, results) { | ||
} | ||
// Create the promise which will execute the | ||
// Create the promise which will execute the command in the pipeline. | ||
const autoPipelinePromise = new CustomPromise(function (resolve, reject) { | ||
@@ -146,0 +150,0 @@ pipeline[exports.kCallbacks].push(function (err, value) { |
@@ -216,2 +216,8 @@ "use strict"; | ||
}, "Pipeline#execBuffer: Use Pipeline#exec instead"); | ||
// NOTE: To avoid an unhandled promise rejection, this will unconditionally always return this.promise, | ||
// which always has the rejection handled by standard-as-callback | ||
// adding the provided rejection callback. | ||
// | ||
// If a different promise instance were returned, that promise would cause its own unhandled promise rejection | ||
// errors, even if that promise unconditionally resolved to **the resolved value of** this.promise. | ||
Pipeline.prototype.exec = function (callback) { | ||
@@ -290,12 +296,14 @@ // Wait for the cluster to be connected, since we need nodes information before continuing | ||
if (this.isCluster) { | ||
return pMap(scripts, (script) => _this.redis.script("load", script.lua), { | ||
pMap(scripts, (script) => _this.redis.script("load", script.lua), { | ||
concurrency: 10, | ||
}).then(function () { | ||
}) | ||
.then(function () { | ||
for (let i = 0; i < scripts.length; i++) { | ||
_this.redis._addedScriptHashes[scripts[i].sha] = true; | ||
} | ||
return execPipeline(); | ||
}); | ||
}) | ||
.then(execPipeline, this.reject); | ||
return this.promise; | ||
} | ||
return this.redis | ||
this.redis | ||
.script("exists", scripts.map(({ sha }) => sha)) | ||
@@ -318,4 +326,5 @@ .then(function (results) { | ||
} | ||
return execPipeline(); | ||
}); | ||
}) | ||
.then(execPipeline, this.reject); | ||
return this.promise; | ||
function execPipeline() { | ||
@@ -322,0 +331,0 @@ let data = ""; |
@@ -100,3 +100,3 @@ "use strict"; | ||
/** | ||
* Detect the argument is a int | ||
* Detect if the argument is a int | ||
* | ||
@@ -178,3 +178,3 @@ * @param {string} value | ||
const result = []; | ||
const keys = Object.keys(obj); | ||
const keys = Object.keys(obj); // Object.entries requires node 7+ | ||
for (let i = 0, l = keys.length; i < l; i++) { | ||
@@ -193,3 +193,3 @@ result.push(keys[i], obj[keys[i]]); | ||
* ```js | ||
* > convertObjectToArray(new Map([[1, '2']])) | ||
* > convertMapToArray(new Map([[1, '2']])) | ||
* [1, '2'] | ||
@@ -196,0 +196,0 @@ * ``` |
@@ -0,1 +1,10 @@ | ||
## [4.28.2](https://github.com/luin/ioredis/compare/v4.28.1...v4.28.2) (2021-12-01) | ||
### Bug Fixes | ||
* add Redis campaign ([#1475](https://github.com/luin/ioredis/issues/1475)) ([3f3d8e9](https://github.com/luin/ioredis/commit/3f3d8e9eb868f4e58bb63926d3b683d9892835f2)) | ||
* fix a memory leak with autopipelining. ([#1470](https://github.com/luin/ioredis/issues/1470)) ([f5d8b73](https://github.com/luin/ioredis/commit/f5d8b73c747a0db5cb36e83e6fe022a19a544bd2)) | ||
* unhandled Promise rejections in pipeline.exec [skip ci] ([#1466](https://github.com/luin/ioredis/issues/1466)) ([e5615da](https://github.com/luin/ioredis/commit/e5615da8786956df08a9b33b6cd4dd31e6eaa759)) | ||
## [4.28.1](https://github.com/luin/ioredis/compare/v4.28.0...v4.28.1) (2021-11-23) | ||
@@ -2,0 +11,0 @@ |
{ | ||
"name": "ioredis", | ||
"version": "4.28.1", | ||
"version": "4.28.2", | ||
"description": "A robust, performance-focused and full-featured Redis client for Node.js.", | ||
@@ -5,0 +5,0 @@ "main": "built/index.js", |
@@ -48,4 +48,2 @@ [![ioredis](https://cdn.jsdelivr.net/gh/luin/ioredis@b5e8c74/logo.svg)](https://github.com/luin/ioredis) | ||
<a href="https://github.com/sponsors/luin">Become a sponsor!</a> | ||
### Upstash: Serverless Database for Redis | ||
@@ -57,6 +55,16 @@ | ||
[Start for free in 30 seconds! ](https://upstash.com/?utm_source=ioredis) | ||
[Start for free in 30 seconds!](https://upstash.com/?utm_source=ioredis) | ||
<br clear="both"/> | ||
### Redis Cloud: From the creators of Redis | ||
<a href="https://redis.info/ioredis-tryfree"><img align="right" width="320" src="resources/redis-tryfree.png" alt="redis-tryfree"></a> | ||
Experience the best Redis. For a limited time, sign up to Redis Enterprise Cloud and use **MATRIX200** to get $200 credits, and a chance to win a Tesla! | ||
[Sign Up Now!](https://redis.info/ioredis-tryfree) | ||
<br clear="both"/> | ||
### Medis: Redis GUI for macOS | ||
@@ -79,6 +87,4 @@ | ||
### Kuber: Kubernetes Dashboard for iOS | ||
<br clear="both"/> | ||
<a href="http://bit.ly/kuber-ios"><img src="resources/kuber.png" alt="Download on the App Store"></a> | ||
<hr> | ||
@@ -85,0 +91,0 @@ |
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
308108
5029
1396