diff --git a/docs/caching.md b/docs/caching.md index 2a193b1290..9d7e87d4e7 100644 --- a/docs/caching.md +++ b/docs/caching.md @@ -149,8 +149,7 @@ Example: } ``` -"options" can be [node_redis specific options](https://github.com/NodeRedis/node_redis#options-object-properties) or [ioredis specific options](https://github.com/luin/ioredis/blob/master/API.md#new-redisport-host-options) depending on what type you're using. - +"options" can be [node_redis specific options](https://github.com/redis/node-redis/blob/master/docs/client-configuration.md) or [ioredis specific options](https://github.com/luin/ioredis/blob/master/API.md#new-redisport-host-options) depending on what type you're using. In case you want to connect to a redis-cluster using IORedis's cluster functionality, you can do that as well by doing the following: diff --git a/src/cache/RedisQueryResultCache.ts b/src/cache/RedisQueryResultCache.ts index 8c60e084fc..8c0d5addca 100644 --- a/src/cache/RedisQueryResultCache.ts +++ b/src/cache/RedisQueryResultCache.ts @@ -50,10 +50,12 @@ export class RedisQueryResultCache implements QueryResultCache { async connect(): Promise { const cacheOptions: any = this.connection.options.cache; if (this.clientType === "redis") { - if (cacheOptions && cacheOptions.options) { - this.client = this.redis.createClient(cacheOptions.options); - } else { - this.client = this.redis.createClient(); + this.client = this.redis.createClient({ + ...cacheOptions?.options, + legacyMode: true + }); + if ("connect" in this.client) { + await this.client.connect(); } } else if (this.clientType === "ioredis") { if (cacheOptions && cacheOptions.port) {