Skip to content

docs(caching): add error event listener example for keyv redis store - #3683

Merged
kamilmysliwiec merged 2 commits into
nestjs:masterfrom
helmipradita:docs/caching-keyv-redis-error-handling
Oct 31, 2026
Merged

kamilmysliwiec merged 2 commits into
nestjs:masterfrom
helmipradita:docs/caching-keyv-redis-error-handling

Conversation

@helmipradita

Copy link
Copy Markdown
Contributor

In the alternative cache stores example using @keyv/redis, connection drops or network partitions cause Keyv's internal Redis client to emit an 'error' event. Without an explicit error listener, Node.js treats this as an unhandled EventEmitter error.

This PR updates the multi-store registerAsync snippet to show assigning the store instance and attaching an 'error' listener, aligning with Keyv and Redis best practices.

helmipradita and others added 2 commits October 31, 2026 16:33
Keep createKeyv() and its error listener in useFactory, and explain in a
warning that Keyv throws on an unhandled 'error' event.
@kamilmysliwiec
kamilmysliwiec merged commit 4511fe6 into nestjs:master Oct 31, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants