Skip to content

Commit d3b4206

Browse files
Merge pull request #2197 from Scrip7/patch-1
docs(caching): fixed invalid redis typings
2 parents c6e212f + ee64a13 commit d3b4206

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

content/techniques/caching.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,18 +220,21 @@ class HttpCacheInterceptor extends CacheInterceptor {
220220
This service takes advantage of [cache-manager](https://github.com/BryanDonovan/node-cache-manager) under the hood. The `cache-manager` package supports a wide-range of useful stores, for example, [Redis store](https://github.com/dabroek/node-cache-manager-redis-store). A full list of supported stores is available [here](https://github.com/BryanDonovan/node-cache-manager#store-engines). To set up the Redis store, simply pass the package together with corresponding options to the `register()` method.
221221
222222
```typescript
223-
import type { ClientOpts as RedisClientOpts } from 'redis'
223+
import type { RedisClientOptions } from 'redis';
224224
import * as redisStore from 'cache-manager-redis-store';
225225
import { CacheModule, Module } from '@nestjs/common';
226226
import { AppController } from './app.controller';
227227

228228
@Module({
229229
imports: [
230-
CacheModule.register<RedisClientOpts>({
230+
CacheModule.register<RedisClientOptions>({
231231
store: redisStore,
232+
232233
// Store-specific configuration:
233-
host: 'localhost',
234-
port: 6379,
234+
socket: {
235+
host: 'localhost',
236+
port: 6379,
237+
},
235238
}),
236239
],
237240
controllers: [AppController],

0 commit comments

Comments
 (0)