You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-07 13:22:56 +03:00
fix(sentinel): Migrated to the new testing framework, fixed issues that were discovered during transition
* [CAE-342] Fix a couple of bugs * Fixed issue with nodes masterauth persistency, changed docker container * [CAE-342] Fixed a couple of sentinel issues, enabled most tests * [CAE-342] Added comment * [CAE-342] Migrate majority of tests to testUtils * [CAE-342] Minor refactor * . * [CAE-342] Using cae containers for sentinel * [CAE-342] Improved resiliency of the legacy tests, added TSdoc comment * [CAE-342] Some extra logging, removed unneeded changes * [CAE-342] Moved docker env as optional part of redisserverdockerconfig * [CAE-342] Move password to serverArguments * [CAE-342] Moved ts-node to devDependencies * [CAE-342] Reverted legacy testing framework improvements
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -345,9 +345,12 @@ export default class RedisSentinel<
|
||||
key: K,
|
||||
value: V
|
||||
) {
|
||||
const proxy = Object.create(this._self);
|
||||
proxy._commandOptions = Object.create(this._self.#commandOptions ?? null);
|
||||
proxy._commandOptions[key] = value;
|
||||
const proxy = Object.create(this);
|
||||
// Create new commandOptions object with the inherited properties
|
||||
proxy._self.#commandOptions = {
|
||||
...(this._self.#commandOptions || {}),
|
||||
[key]: value
|
||||
};
|
||||
return proxy as RedisSentinelType<
|
||||
M,
|
||||
F,
|
||||
@@ -682,9 +685,10 @@ class RedisSentinelInternal<
|
||||
|
||||
async #connect() {
|
||||
let count = 0;
|
||||
while (true) {
|
||||
while (true) {
|
||||
this.#trace("starting connect loop");
|
||||
|
||||
count+=1;
|
||||
if (this.#destroy) {
|
||||
this.#trace("in #connect and want to destroy")
|
||||
return;
|
||||
@@ -1109,7 +1113,7 @@ class RedisSentinelInternal<
|
||||
|
||||
this.#trace(`transform: destroying old masters if open`);
|
||||
for (const client of this.#masterClients) {
|
||||
masterWatches.push(client.isWatching);
|
||||
masterWatches.push(client.isWatching || client.isDirtyWatch);
|
||||
|
||||
if (client.isOpen) {
|
||||
client.destroy()
|
||||
@@ -1460,4 +1464,4 @@ export class RedisSentinelFactory extends EventEmitter {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
@@ -602,4 +602,4 @@ export class SentinelFramework extends DockerBase {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user