You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-07 13:22:56 +03:00
Merge branch 'master' of github.com:redis/node-redis into v5
This commit is contained in:
@@ -25,5 +25,17 @@
|
|||||||
"ts-node": "^10.9.1",
|
"ts-node": "^10.9.1",
|
||||||
"typedoc": "^0.23.28",
|
"typedoc": "^0.23.28",
|
||||||
"typescript": "^5.0.2"
|
"typescript": "^5.0.2"
|
||||||
}
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git://github.com/redis/node-redis.git"
|
||||||
|
},
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/redis/node-redis/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/redis/node-redis/tree/master/packages/bloom",
|
||||||
|
"keywords": [
|
||||||
|
"redis",
|
||||||
|
"RedisBloom"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
@@ -647,6 +647,9 @@ describe('Client', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
testUtils.testWithClient('should propagated errors from "isolated" clients', client => {
|
testUtils.testWithClient('should propagated errors from "isolated" clients', client => {
|
||||||
|
client.on('error', () => {
|
||||||
|
// ignore errors
|
||||||
|
});
|
||||||
return client.executeIsolated(isolated => killClient(isolated, client));
|
return client.executeIsolated(isolated => killClient(isolated, client));
|
||||||
}, GLOBAL.SERVERS.OPEN);
|
}, GLOBAL.SERVERS.OPEN);
|
||||||
|
|
||||||
|
@@ -307,7 +307,7 @@ export class PubSub {
|
|||||||
this.#isActive = (
|
this.#isActive = (
|
||||||
this.#listeners[PubSubType.CHANNELS].size !== 0 ||
|
this.#listeners[PubSubType.CHANNELS].size !== 0 ||
|
||||||
this.#listeners[PubSubType.PATTERNS].size !== 0 ||
|
this.#listeners[PubSubType.PATTERNS].size !== 0 ||
|
||||||
this.#listeners[PubSubType.CHANNELS].size !== 0 ||
|
this.#listeners[PubSubType.SHARDED].size !== 0 ||
|
||||||
this.#subscribing !== 0
|
this.#subscribing !== 0
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@@ -199,7 +199,7 @@ export default class RedisSocket extends EventEmitter {
|
|||||||
.off('error', reject)
|
.off('error', reject)
|
||||||
.once('error', (err: Error) => this.#onSocketError(err))
|
.once('error', (err: Error) => this.#onSocketError(err))
|
||||||
.once('close', hadError => {
|
.once('close', hadError => {
|
||||||
if (!hadError && this.#isReady && this.#socket === socket) {
|
if (!hadError && this.#isOpen && this.#socket === socket) {
|
||||||
this.#onSocketError(new SocketClosedUnexpectedlyError());
|
this.#onSocketError(new SocketClosedUnexpectedlyError());
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@@ -2,6 +2,7 @@ import { strict as assert } from 'assert';
|
|||||||
import testUtils, { GLOBAL, waitTillBeenCalled } from '../test-utils';
|
import testUtils, { GLOBAL, waitTillBeenCalled } from '../test-utils';
|
||||||
import RedisCluster from '.';
|
import RedisCluster from '.';
|
||||||
import { ClusterSlotStates } from '../commands/CLUSTER_SETSLOT';
|
import { ClusterSlotStates } from '../commands/CLUSTER_SETSLOT';
|
||||||
|
import { commandOptions } from '../command-options';
|
||||||
import { SQUARE_SCRIPT } from '../client/index.spec';
|
import { SQUARE_SCRIPT } from '../client/index.spec';
|
||||||
import { RootNodesUnavailableError } from '../errors';
|
import { RootNodesUnavailableError } from '../errors';
|
||||||
import { spy } from 'sinon';
|
import { spy } from 'sinon';
|
||||||
@@ -178,6 +179,21 @@ describe('Cluster', () => {
|
|||||||
await assert.rejects(cluster.mGet(['a', 'b']));
|
await assert.rejects(cluster.mGet(['a', 'b']));
|
||||||
}, GLOBAL.CLUSTERS.OPEN);
|
}, GLOBAL.CLUSTERS.OPEN);
|
||||||
|
|
||||||
|
testUtils.testWithCluster('should send commands with commandOptions to correct cluster slot (without redirections)', async cluster => {
|
||||||
|
// 'a' and 'b' hash to different cluster slots (see previous unit test)
|
||||||
|
// -> maxCommandRedirections 0: rejects on MOVED/ASK reply
|
||||||
|
await cluster.set(commandOptions({ isolated: true }), 'a', '1'),
|
||||||
|
await cluster.set(commandOptions({ isolated: true }), 'b', '2'),
|
||||||
|
|
||||||
|
assert.equal(await cluster.get('a'), '1');
|
||||||
|
assert.equal(await cluster.get('b'), '2');
|
||||||
|
}, {
|
||||||
|
...GLOBAL.CLUSTERS.OPEN,
|
||||||
|
clusterConfiguration: {
|
||||||
|
maxCommandRedirections: 0
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
describe('minimizeConnections', () => {
|
describe('minimizeConnections', () => {
|
||||||
testUtils.testWithCluster('false', async cluster => {
|
testUtils.testWithCluster('false', async cluster => {
|
||||||
for (const master of cluster.masters) {
|
for (const master of cluster.masters) {
|
||||||
|
@@ -45,5 +45,8 @@
|
|||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/redis/node-redis/issues"
|
"url": "https://github.com/redis/node-redis/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/redis/node-redis/tree/master/packages/client"
|
"homepage": "https://github.com/redis/node-redis/tree/master/packages/client",
|
||||||
|
"keywords": [
|
||||||
|
"redis"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
@@ -25,5 +25,16 @@
|
|||||||
"ts-node": "^10.9.1",
|
"ts-node": "^10.9.1",
|
||||||
"typedoc": "^0.23.28",
|
"typedoc": "^0.23.28",
|
||||||
"typescript": "^5.0.2"
|
"typescript": "^5.0.2"
|
||||||
}
|
},
|
||||||
}
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git://github.com/redis/node-redis.git"
|
||||||
|
},
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/redis/node-redis/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/redis/node-redis/tree/master/packages/graph",
|
||||||
|
"keywords": [
|
||||||
|
"redis",
|
||||||
|
"RedisGraph"
|
||||||
|
]}
|
||||||
|
@@ -25,5 +25,17 @@
|
|||||||
"ts-node": "^10.9.1",
|
"ts-node": "^10.9.1",
|
||||||
"typedoc": "^0.23.28",
|
"typedoc": "^0.23.28",
|
||||||
"typescript": "^5.0.2"
|
"typescript": "^5.0.2"
|
||||||
}
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git://github.com/redis/node-redis.git"
|
||||||
|
},
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/redis/node-redis/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/redis/node-redis/tree/master/packages/json",
|
||||||
|
"keywords": [
|
||||||
|
"redis",
|
||||||
|
"RedisJSON"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
@@ -25,5 +25,16 @@
|
|||||||
"ts-node": "^10.9.1",
|
"ts-node": "^10.9.1",
|
||||||
"typedoc": "^0.23.28",
|
"typedoc": "^0.23.28",
|
||||||
"typescript": "^5.0.2"
|
"typescript": "^5.0.2"
|
||||||
}
|
},
|
||||||
}
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git://github.com/redis/node-redis.git"
|
||||||
|
},
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/redis/node-redis/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/redis/node-redis/tree/master/packages/search",
|
||||||
|
"keywords": [
|
||||||
|
"redis",
|
||||||
|
"RediSearch"
|
||||||
|
]}
|
||||||
|
@@ -25,5 +25,16 @@
|
|||||||
"ts-node": "^10.9.1",
|
"ts-node": "^10.9.1",
|
||||||
"typedoc": "^0.23.28",
|
"typedoc": "^0.23.28",
|
||||||
"typescript": "^5.0.2"
|
"typescript": "^5.0.2"
|
||||||
}
|
},
|
||||||
}
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git://github.com/redis/node-redis.git"
|
||||||
|
},
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/redis/node-redis/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/redis/node-redis/tree/master/packages/time-series",
|
||||||
|
"keywords": [
|
||||||
|
"redis",
|
||||||
|
"RedisTimeSeries"
|
||||||
|
]}
|
||||||
|
Reference in New Issue
Block a user