ioredis 4.27.9 → 4.27.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Changelog.md +7 -0
- package/README.md +1 -1
- package/built/autoPipelining.js +3 -0
- package/built/cluster/ClusterOptions.js +1 -0
- package/built/cluster/util.js +1 -0
- package/built/connectors/SentinelConnector/FailoverDetector.js +1 -0
- package/built/connectors/SentinelConnector/index.js +1 -0
- package/built/connectors/StandaloneConnector.js +1 -0
- package/built/connectors/index.js +1 -0
- package/built/errors/index.js +1 -0
- package/built/index.js +9 -8
- package/built/pipeline.js +5 -1
- package/built/promiseContainer.js +1 -0
- package/built/redis/RedisOptions.js +1 -0
- package/built/redis/event_handler.js +1 -0
- package/built/transaction.js +3 -0
- package/built/utils/debug.js +1 -0
- package/built/utils/index.js +4 -3
- package/built/utils/lodash.js +1 -0
- package/package.json +1 -1
package/Changelog.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [4.27.10](https://github.com/luin/ioredis/compare/v4.27.9...v4.27.10) (2021-10-04)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **cluster:** lazyConnect with pipeline ([#1408](https://github.com/luin/ioredis/issues/1408)) ([b798107](https://github.com/luin/ioredis/commit/b798107e4123d0027ef1bdb3319cd00516221f3b))
|
|
7
|
+
|
|
1
8
|
## [4.27.9](https://github.com/luin/ioredis/compare/v4.27.8...v4.27.9) (2021-08-30)
|
|
2
9
|
|
|
3
10
|
|
package/README.md
CHANGED
|
@@ -578,7 +578,7 @@ redis.get("k3", (err, result) => {
|
|
|
578
578
|
});
|
|
579
579
|
```
|
|
580
580
|
|
|
581
|
-
Another useful example of a reply transformer is one that changes `hgetall` to return array of arrays instead of objects which avoids
|
|
581
|
+
Another useful example of a reply transformer is one that changes `hgetall` to return array of arrays instead of objects which avoids an unwanted conversation of hash keys to strings when dealing with binary hash keys:
|
|
582
582
|
|
|
583
583
|
```javascript
|
|
584
584
|
Redis.Command.setReplyTransformer("hgetall", (result) => {
|
package/built/autoPipelining.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.executeWithAutoPipelining = exports.getFirstValueInFlattenedArray = exports.shouldUseAutoPipelining = exports.notAllowedAutoPipelineCommands = exports.kCallbacks = exports.kExec = void 0;
|
|
3
4
|
const PromiseContainer = require("./promiseContainer");
|
|
4
5
|
const lodash_1 = require("./utils/lodash");
|
|
5
6
|
const calculateSlot = require("cluster-key-slot");
|
|
@@ -100,6 +101,8 @@ function executeWithAutoPipelining(client, functionName, commandName, args, call
|
|
|
100
101
|
const CustomPromise = PromiseContainer.get();
|
|
101
102
|
// On cluster mode let's wait for slots to be available
|
|
102
103
|
if (client.isCluster && !client.slots.length) {
|
|
104
|
+
if (client.status === "wait")
|
|
105
|
+
client.connect().catch(lodash_1.noop);
|
|
103
106
|
return new CustomPromise(function (resolve, reject) {
|
|
104
107
|
client.delayUntilReady((err) => {
|
|
105
108
|
if (err) {
|
package/built/cluster/util.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getConnectionName = exports.weightSrvRecords = exports.groupSrvRecords = exports.getUniqueHostnamesFromOptions = exports.normalizeNodeOptions = exports.nodeKeyToRedisOptions = exports.getNodeKey = void 0;
|
|
3
4
|
const utils_1 = require("../utils");
|
|
4
5
|
const net_1 = require("net");
|
|
5
6
|
function getNodeKey(node) {
|
|
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.FailoverDetector = void 0;
|
|
12
13
|
const utils_1 = require("../../utils");
|
|
13
14
|
const debug = utils_1.Debug("FailoverDetector");
|
|
14
15
|
const CHANNEL_NAME = "+switch-master";
|
|
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SentinelIterator = void 0;
|
|
12
13
|
const net_1 = require("net");
|
|
13
14
|
const utils_1 = require("../../utils");
|
|
14
15
|
const tls_1 = require("tls");
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SentinelConnector = exports.StandaloneConnector = void 0;
|
|
3
4
|
const StandaloneConnector_1 = require("./StandaloneConnector");
|
|
4
5
|
exports.StandaloneConnector = StandaloneConnector_1.default;
|
|
5
6
|
const SentinelConnector_1 = require("./SentinelConnector");
|
package/built/errors/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MaxRetriesPerRequestError = void 0;
|
|
3
4
|
const MaxRetriesPerRequestError_1 = require("./MaxRetriesPerRequestError");
|
|
4
5
|
exports.MaxRetriesPerRequestError = MaxRetriesPerRequestError_1.default;
|
package/built/index.js
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.print = exports.ReplyError = void 0;
|
|
3
4
|
exports = module.exports = require("./redis").default;
|
|
4
5
|
var redis_1 = require("./redis");
|
|
5
|
-
exports
|
|
6
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return redis_1.default; } });
|
|
6
7
|
var cluster_1 = require("./cluster");
|
|
7
|
-
exports
|
|
8
|
+
Object.defineProperty(exports, "Cluster", { enumerable: true, get: function () { return cluster_1.default; } });
|
|
8
9
|
var command_1 = require("./command");
|
|
9
|
-
exports
|
|
10
|
+
Object.defineProperty(exports, "Command", { enumerable: true, get: function () { return command_1.default; } });
|
|
10
11
|
var ScanStream_1 = require("./ScanStream");
|
|
11
|
-
exports
|
|
12
|
+
Object.defineProperty(exports, "ScanStream", { enumerable: true, get: function () { return ScanStream_1.default; } });
|
|
12
13
|
var pipeline_1 = require("./pipeline");
|
|
13
|
-
exports
|
|
14
|
+
Object.defineProperty(exports, "Pipeline", { enumerable: true, get: function () { return pipeline_1.default; } });
|
|
14
15
|
var AbstractConnector_1 = require("./connectors/AbstractConnector");
|
|
15
|
-
exports
|
|
16
|
+
Object.defineProperty(exports, "AbstractConnector", { enumerable: true, get: function () { return AbstractConnector_1.default; } });
|
|
16
17
|
var SentinelConnector_1 = require("./connectors/SentinelConnector");
|
|
17
|
-
exports
|
|
18
|
-
exports
|
|
18
|
+
Object.defineProperty(exports, "SentinelConnector", { enumerable: true, get: function () { return SentinelConnector_1.default; } });
|
|
19
|
+
Object.defineProperty(exports, "SentinelIterator", { enumerable: true, get: function () { return SentinelConnector_1.SentinelIterator; } });
|
|
19
20
|
// No TS typings
|
|
20
21
|
exports.ReplyError = require("redis-errors").ReplyError;
|
|
21
22
|
const PromiseContainer = require("./promiseContainer");
|
package/built/pipeline.js
CHANGED
|
@@ -8,6 +8,7 @@ const calculateSlot = require("cluster-key-slot");
|
|
|
8
8
|
const pMap = require("p-map");
|
|
9
9
|
const PromiseContainer = require("./promiseContainer");
|
|
10
10
|
const commander_1 = require("./commander");
|
|
11
|
+
const utils_1 = require("./utils");
|
|
11
12
|
/*
|
|
12
13
|
This function derives from the cluster-key-slot implementation.
|
|
13
14
|
Instead of checking that all keys have the same slot, it checks that all slots are served by the same set of nodes.
|
|
@@ -140,7 +141,8 @@ Pipeline.prototype.fillResult = function (value, position) {
|
|
|
140
141
|
moved: function (slot, key) {
|
|
141
142
|
_this.preferKey = key;
|
|
142
143
|
_this.redis.slots[errv[1]] = [key];
|
|
143
|
-
_this.redis._groupsBySlot[errv[1]] =
|
|
144
|
+
_this.redis._groupsBySlot[errv[1]] =
|
|
145
|
+
_this.redis._groupsIds[_this.redis.slots[errv[1]].join(";")];
|
|
144
146
|
_this.redis.refreshSlotsCache();
|
|
145
147
|
_this.exec();
|
|
146
148
|
},
|
|
@@ -214,6 +216,8 @@ Pipeline.prototype.execBuffer = util_1.deprecate(function () {
|
|
|
214
216
|
Pipeline.prototype.exec = function (callback) {
|
|
215
217
|
// Wait for the cluster to be connected, since we need nodes information before continuing
|
|
216
218
|
if (this.isCluster && !this.redis.slots.length) {
|
|
219
|
+
if (this.redis.status === "wait")
|
|
220
|
+
this.redis.connect().catch(utils_1.noop);
|
|
217
221
|
this.redis.delayUntilReady((err) => {
|
|
218
222
|
if (err) {
|
|
219
223
|
callback(err);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.readyHandler = exports.errorHandler = exports.closeHandler = exports.connectHandler = void 0;
|
|
3
4
|
const redis_errors_1 = require("redis-errors");
|
|
4
5
|
const command_1 = require("../command");
|
|
5
6
|
const errors_1 = require("../errors");
|
package/built/transaction.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addTransactionSupport = void 0;
|
|
3
4
|
const utils_1 = require("./utils");
|
|
4
5
|
const standard_as_callback_1 = require("standard-as-callback");
|
|
5
6
|
const pipeline_1 = require("./pipeline");
|
|
@@ -29,6 +30,8 @@ function addTransactionSupport(redis) {
|
|
|
29
30
|
pipeline.exec = function (callback) {
|
|
30
31
|
// Wait for the cluster to be connected, since we need nodes information before continuing
|
|
31
32
|
if (this.isCluster && !this.redis.slots.length) {
|
|
33
|
+
if (this.redis.status === "wait")
|
|
34
|
+
this.redis.connect().catch(utils_1.noop);
|
|
32
35
|
return standard_as_callback_1.default(new Promise((resolve, reject) => {
|
|
33
36
|
this.redis.delayUntilReady((err) => {
|
|
34
37
|
if (err) {
|
package/built/utils/debug.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.genRedactedString = exports.getStringValue = exports.MAX_ARGUMENT_LENGTH = void 0;
|
|
3
4
|
const debug_1 = require("debug");
|
|
4
5
|
const MAX_ARGUMENT_LENGTH = 200;
|
|
5
6
|
exports.MAX_ARGUMENT_LENGTH = MAX_ARGUMENT_LENGTH;
|
package/built/utils/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.flatten = exports.noop = exports.defaults = exports.Debug = exports.zipMap = exports.CONNECTION_CLOSED_ERROR_MSG = exports.shuffle = exports.sample = exports.parseURL = exports.optimizeErrorStack = exports.toArg = exports.convertMapToArray = exports.convertObjectToArray = exports.timeout = exports.packObject = exports.isInt = exports.wrapMultiResult = exports.convertBufferToString = exports.bufferEqual = void 0;
|
|
3
4
|
const url_1 = require("url");
|
|
4
5
|
const lodash_1 = require("./lodash");
|
|
5
|
-
exports
|
|
6
|
-
exports
|
|
7
|
-
exports
|
|
6
|
+
Object.defineProperty(exports, "defaults", { enumerable: true, get: function () { return lodash_1.defaults; } });
|
|
7
|
+
Object.defineProperty(exports, "noop", { enumerable: true, get: function () { return lodash_1.noop; } });
|
|
8
|
+
Object.defineProperty(exports, "flatten", { enumerable: true, get: function () { return lodash_1.flatten; } });
|
|
8
9
|
const debug_1 = require("./debug");
|
|
9
10
|
exports.Debug = debug_1.default;
|
|
10
11
|
/**
|
package/built/utils/lodash.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isArguments = exports.flatten = exports.defaults = exports.noop = void 0;
|
|
3
4
|
const defaults = require("lodash.defaults");
|
|
4
5
|
exports.defaults = defaults;
|
|
5
6
|
const flatten = require("lodash.flatten");
|